tx · A8x9rZyXp95QyYfHAvu9ewpFJU1fMKAB1Je8auYDMKni

3N6G8j53WGVsDVPR8R8GBxmsaqkML1ayNKV:  -0.01700000 Waves

2023.05.10 13:16 [2571656] smart account 3N6G8j53WGVsDVPR8R8GBxmsaqkML1ayNKV > SELF 0.00000000 Waves

{ "type": 13, "id": "A8x9rZyXp95QyYfHAvu9ewpFJU1fMKAB1Je8auYDMKni", "fee": 1700000, "feeAssetId": null, "timestamp": 1683713806954, "version": 2, "chainId": 84, "sender": "3N6G8j53WGVsDVPR8R8GBxmsaqkML1ayNKV", "senderPublicKey": "G8swj2SJhdPvP3eHnoPqp9DM2w2LQJABHJSY3ygtNSSo", "proofs": [ "4F2h3bu5BzuSH1LM8f3e9arivvcLvhoP7y8bufQzDZUrPkZquYAT5kyB8TJ4MPCLGXvb2ocmcf5VYVUrwPLMUeJV" ], "script": "base64:BgLeEggCEgUKAwgIBBIFCgMIGAESBwoFEQgYAQESBgoECAgICBIGCgQICAgCEgUKAwgIBBIGCgQICAEBEgQKAggYEgMKAQgSABIECgIICBIDCgEIEgQKAggIIglzZXBhcmF0b3IiDGtleVd4QXNzZXRJZCITa2V5QmFja2VuZFB1YmxpY0tleSIba2V5RXhpc3RzUmVmZXJyZXJUb1JlZmVycmFsIgtwcm9ncmFtTmFtZSIPcmVmZXJyZXJBZGRyZXNzIg9yZWZlcnJhbEFkZHJlc3MiEmtleUNsYWltZWRSZWZlcnJlciIOY2xhaW1lckFkZHJlc3MiEmtleUNsYWltZWRSZWZlcnJhbCIUa2V5VW5jbGFpbWVkUmVmZXJyZXIiFGtleVVuY2xhaW1lZFJlZmVycmFsIgtrZXlSZWZlcnJlciIOa2V5UHJvZ3JhbU5hbWUiFWtleVRvdGFsUmVmZXJyYWxDb3VudCIWa2V5QWN0aXZlUmVmZXJyYWxDb3VudCITa2V5SXNSZWZlcnJhbEFjdGl2ZSIWa2V5Q2xhaW1lZFRvdGFsQWRkcmVzcyIHYWRkcmVzcyIYa2V5VW5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RWxzZQIJAJ8IAQkBAXQBBQJhdQAACQCUCgIFA25pbAkAzAgCBQJhagkAzAgCBQJhaQUDbmlsAVEBDHNldFRvdGFsS2V5cwIBZQFzBAJiSQkBC3ZhbHVlT3JFbHNlAgkAnwgBCQEBaAIFAWUFAXMAAAQCYkoJAQt2YWx1ZU9yRWxzZQIJAJ8IAQkBAWoCBQFlBQFzAAAEAmFBCQELdmFsdWVPckVsc2UCCQCfCAEJAQFrAgUBZQUBcwAABAJiSwkBC3ZhbHVlT3JFbHNlAgkAnwgBCQEBbAIFAWUFAXMAAAQCYWkJAGQCBQJiSQUCYkoEAmFqCQBkAgUCYUEFAmJLCQCUCgIJAMwIAgkBDEludGVnZXJFbnRyeQIJAQFyAQUBcwUCYWkJAMwIAgkBDEludGVnZXJFbnRyeQIJAQF0AQUBcwUCYWoFA25pbAUEdW5pdAECYkwBAmJNAAQCYk4EAUQJAQFOAAMJAAECBQFEAgpCeXRlVmVjdG9yBAFTBQFEBQFTAwkAAQIFAUQCBFVuaXQIBQJiTA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCYkwJYm9keUJ5dGVzCQCRAwIIBQJiTAZwcm9vZnMAAAUCYk44C0QG", "height": 2571656, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6avgBrkSjVmTjA6vuNDMQP7TyUeeSVWT4hYJptRQpNPJ Next: none Diff:
OldNewDifferences
6868 func keyManagerVaultAddress () = "%s__managerVaultAddress"
6969
7070
71-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
71+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
72+ case s: String =>
73+ addressFromStringValue(s)
74+ case _ =>
75+ this
76+}
7277
7378
7479 func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator)
8186
8287
8388 func managerPublicKeyOrUnit () = {
84- let managerVaultAddress = getManagerAddressOrFail()
89+ let managerVaultAddress = getManagerVaultAddressOrThis()
8590 match getString(managerVaultAddress, keyManagerPublicKey()) {
8691 case s: String =>
8792 fromBase58String(s)
131136 else throwErr("program does not exist")
132137 if ((checkProgramExists == checkProgramExists))
133138 then {
134- let $t047005637 = if (isImplementationContract)
139+ let $t047645701 = if (isImplementationContract)
135140 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"))
136141 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"))
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
142+ let claimerClaimed = $t047645701._1
143+ let claimerUnclaimed = $t047645701._2
144+ let keyClaimed = $t047645701._3
145+ let keyUnclaimed = $t047645701._4
146+ let claimHistoryKey = $t047645701._5
142147 let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0)
143148 let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName)))))
144149 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 func keyWxAssetId () = makeString(["%s", "wxAssetId"], separator)
77
88
99 let keyBackendPublicKey = makeString(["%s", "backendPublicKey"], separator)
1010
1111 func keyExistsReferrerToReferral (programName,referrerAddress,referralAddress) = makeString(["%s%s%s%s", "existsReferrerToReferral", programName, referrerAddress, referralAddress], separator)
1212
1313
1414 func keyClaimedReferrer (programName,claimerAddress) = makeString(["%s%s%s", "claimedReferrer", programName, claimerAddress], separator)
1515
1616
1717 func keyClaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "claimedReferral", programName, claimerAddress], separator)
1818
1919
2020 func keyUnclaimedReferrer (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferrer", programName, claimerAddress], separator)
2121
2222
2323 func keyUnclaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferral", programName, claimerAddress], separator)
2424
2525
2626 func keyReferrer (programName,referralAddress) = makeString(["%s%s%s", "referrer", programName, referralAddress], separator)
2727
2828
2929 func keyProgramName (programName) = makeString(["%s%s", "programName", programName], separator)
3030
3131
3232 func keyTotalReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "totalReferralCount", programName, referrerAddress], separator)
3333
3434
3535 func keyActiveReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "activeReferralCount", programName, referrerAddress], separator)
3636
3737
3838 func keyIsReferralActive (programName,referralAddress) = makeString(["%s%s%s", "activeReferral", programName, referralAddress], separator)
3939
4040
4141 func keyClaimedTotalAddress (address) = makeString(["%s%s", "claimedTotalAddress", address], separator)
4242
4343
4444 func keyUnclaimedTotalAddress (address) = makeString(["%s%s", "unclaimedTotalAddress", address], separator)
4545
4646
4747 func keyClaimedTotal (programName) = makeString(["%s%s", "claimedTotal", programName], separator)
4848
4949
5050 func keyRewardsTotal (programName) = makeString(["%s%s", "rewardsTotal", programName], separator)
5151
5252
5353 func keyRewardAssetId (programName) = makeString(["%s%s", "rewardAssetId", programName], separator)
5454
5555
5656 func keyTreasuryContract (programName) = makeString(["%s%s", "treasuryContract", programName], separator)
5757
5858
5959 func keyImplementationContract (programName) = makeString(["%s%s", "implementationContract", programName], separator)
6060
6161
6262 func keyAllReferralPrograms (address) = makeString(["%s%s", "allReferralPrograms", address], separator)
6363
6464
6565 func keyManagerPublicKey () = "%s__managerPublicKey"
6666
6767
6868 func keyManagerVaultAddress () = "%s__managerVaultAddress"
6969
7070
71-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
71+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
72+ case s: String =>
73+ addressFromStringValue(s)
74+ case _ =>
75+ this
76+}
7277
7378
7479 func keyClaimHistory (programName,userAddress,transactionId,type) = makeString(["%s%s%s%s%s", "history", type, programName, userAddress, transactionId], separator)
7580
7681
7782 func formatClaimHistory (amount) = makeString(["%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], separator)
7883
7984
8085 func throwErr (msg) = throw(makeString(["referral.ride:", msg], " "))
8186
8287
8388 func managerPublicKeyOrUnit () = {
84- let managerVaultAddress = getManagerAddressOrFail()
89+ let managerVaultAddress = getManagerVaultAddressOrThis()
8590 match getString(managerVaultAddress, keyManagerPublicKey()) {
8691 case s: String =>
8792 fromBase58String(s)
8893 case _: Unit =>
8994 unit
9095 case _ =>
9196 throw("Match error")
9297 }
9398 }
9499
95100
96101 func mustManager (i) = {
97102 let pd = throwErr("permission denied")
98103 match managerPublicKeyOrUnit() {
99104 case pk: ByteVector =>
100105 if ((i.callerPublicKey == pk))
101106 then true
102107 else pd
103108 case _: Unit =>
104109 if ((i.caller == this))
105110 then true
106111 else pd
107112 case _ =>
108113 throw("Match error")
109114 }
110115 }
111116
112117
113118 func updateAllReferralPrograms (address,programName) = {
114119 let allReferralPrograms = valueOrElse(getString(keyAllReferralPrograms(address)), "")
115120 let updatedAllReferralPrograms = if (contains(allReferralPrograms, programName))
116121 then nil
117122 else {
118123 let newAllReferralPrograms = if ((allReferralPrograms == ""))
119124 then programName
120125 else makeString([allReferralPrograms, programName], separator)
121126 [StringEntry(keyAllReferralPrograms(address), newAllReferralPrograms)]
122127 }
123128 updatedAllReferralPrograms
124129 }
125130
126131
127132 @Callable(i)
128133 func claimInternal (programName,claimerAddress,isImplementationContract) = {
129134 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
130135 then true
131136 else throwErr("program does not exist")
132137 if ((checkProgramExists == checkProgramExists))
133138 then {
134- let $t047005637 = if (isImplementationContract)
139+ let $t047645701 = if (isImplementationContract)
135140 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"))
136141 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"))
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
142+ let claimerClaimed = $t047645701._1
143+ let claimerUnclaimed = $t047645701._2
144+ let keyClaimed = $t047645701._3
145+ let keyUnclaimed = $t047645701._4
146+ let claimHistoryKey = $t047645701._5
142147 let claimedTotal = valueOrElse(getInteger(keyClaimedTotal(programName)), 0)
143148 let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName)))))
144149 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
145150 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimerAddress)), 0)
146151 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimerAddress)), 0)
147152 if (if (isImplementationContract)
148153 then (claimerUnclaimed == 0)
149154 else false)
150155 then $Tuple2(nil, 0)
151156 else {
152157 let checkCanClaim = if ((claimerUnclaimed > 0))
153158 then true
154159 else throwErr("nothing to claim")
155160 if ((checkCanClaim == checkCanClaim))
156161 then {
157162 let newClaimerClaimed = (claimerClaimed + claimerUnclaimed)
158163 let newClaimedTotal = (claimedTotal + claimerUnclaimed)
159164 let newClaimedTotalAddress = (claimedTotalAddress + claimerUnclaimed)
160165 let newUnclaimedTotalAddress = (unclaimedTotalAddress - claimerUnclaimed)
161166 let balanceBefore = value(assetBalance(this, rewardAssetId))
162167 if ((balanceBefore == balanceBefore))
163168 then {
164169 let res = invoke(treasuryContract, "withdrawReferralReward", [claimerUnclaimed], nil)
165170 if ((res == res))
166171 then {
167172 let balanceAfter = value(assetBalance(this, rewardAssetId))
168173 if ((balanceAfter == balanceAfter))
169174 then {
170175 let balanceDiff = (balanceAfter - balanceBefore)
171176 if ((balanceDiff == balanceDiff))
172177 then {
173178 let checkBalance = if ((balanceDiff == claimerUnclaimed))
174179 then true
175180 else throwErr("insufficient balance on referral contract")
176181 if ((checkBalance == checkBalance))
177182 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)
178183 else throw("Strict value is not equal to itself.")
179184 }
180185 else throw("Strict value is not equal to itself.")
181186 }
182187 else throw("Strict value is not equal to itself.")
183188 }
184189 else throw("Strict value is not equal to itself.")
185190 }
186191 else throw("Strict value is not equal to itself.")
187192 }
188193 else throw("Strict value is not equal to itself.")
189194 }
190195 }
191196 else throw("Strict value is not equal to itself.")
192197 }
193198
194199
195200
196201 @Callable(i)
197202 func claimBulkInternal (claimer,programNames,currentIter) = {
198203 let checkCaller = if ((i.caller == this))
199204 then true
200205 else throwErr("permission denied")
201206 if ((checkCaller == checkCaller))
202207 then if ((currentIter == size(programNames)))
203208 then nil
204209 else {
205210 let programName = programNames[currentIter]
206211 let programUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0)
207212 let claimHistoryKey = keyClaimHistory(programName, claimer, toBase58String(i.transactionId), "claimBulk")
208213 let claimBulkInternal = invoke(this, "claimBulkInternal", [claimer, programNames, (currentIter + 1)], nil)
209214 if ((claimBulkInternal == claimBulkInternal))
210215 then {
211216 let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, claimer)), 0)
212217 let claim = if ((unclaimedReferrer > 0))
213218 then invoke(this, "claimInternal", [programName, claimer, false], nil)
214219 else unit
215220 if ((claim == claim))
216221 then $Tuple2(nil, [claimBulkInternal, claim])
217222 else throw("Strict value is not equal to itself.")
218223 }
219224 else throw("Strict value is not equal to itself.")
220225 }
221226 else throw("Strict value is not equal to itself.")
222227 }
223228
224229
225230
226231 @Callable(i)
227232 func incUnclaimedWithPaymentInternal (paymentAmounts,programName,referrerAddresses,currentIter,resAmount) = {
228233 let checkCaller = if ((i.caller == this))
229234 then true
230235 else throwErr("permission denied")
231236 if ((checkCaller == checkCaller))
232237 then {
233238 let argsComparison = (size(paymentAmounts) == size(referrerAddresses))
234239 let check = if (argsComparison)
235240 then true
236241 else throwErr("lists in args must be same size")
237242 if ((check == check))
238243 then if ((currentIter == size(paymentAmounts)))
239244 then $Tuple2(nil, resAmount)
240245 else {
241246 let referrerAddress = referrerAddresses[currentIter]
242247 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
243248 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
244249 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
245250 let newUnclaimedTotalAddress = (unclaimedTotalAddress + paymentAmounts[currentIter])
246251 let newReferrerUnclaimed = (referrerUnclaimed + paymentAmounts[currentIter])
247252 let newResAmount = (resAmount + paymentAmounts[currentIter])
248253 let inv = invoke(this, "incUnclaimedWithPaymentInternal", [paymentAmounts, programName, referrerAddresses, (currentIter + 1), newResAmount], nil)
249254 if ((inv == inv))
250255 then {
251256 let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName)
252257 $Tuple2(([IntegerEntry(keyUnclaimedTotalAddress(referrerAddress), newUnclaimedTotalAddress), IntegerEntry(keyUnclaimedReferrer(programName, referrerAddress), newReferrerUnclaimed), IntegerEntry(keyRewardsTotal(programName), (rewardsTotal + paymentAmounts[currentIter]))] ++ updatedAllReferrerPrograms), inv)
253258 }
254259 else throw("Strict value is not equal to itself.")
255260 }
256261 else throw("Strict value is not equal to itself.")
257262 }
258263 else throw("Strict value is not equal to itself.")
259264 }
260265
261266
262267
263268 @Callable(i)
264269 func createReferralProgram (programName,treasuryContract,implementationContract,rewardAssetId) = {
265270 let checkCaller = mustManager(i)
266271 if ((checkCaller == checkCaller))
267272 then {
268273 let checkProgramName = if ((getBoolean(keyProgramName(programName)) == unit))
269274 then true
270275 else throwErr("program name already exists")
271276 if ((checkProgramName == checkProgramName))
272277 then {
273278 let programNameIsValid = if (!(contains(programName, separator)))
274279 then !(contains(programName, " "))
275280 else false
276281 let checkProgramExists = if (programNameIsValid)
277282 then true
278283 else throwErr("invalid program name")
279284 if ((checkProgramExists == checkProgramExists))
280285 then {
281286 let checkRewardAsset = if ((assetInfo(fromBase58String(rewardAssetId)) != unit))
282287 then true
283288 else throwErr("invalid reward asset id")
284289 if ((checkRewardAsset == checkRewardAsset))
285290 then $Tuple2([BooleanEntry(keyProgramName(programName), true), StringEntry(keyTreasuryContract(programName), treasuryContract), StringEntry(keyImplementationContract(programName), implementationContract), StringEntry(keyRewardAssetId(programName), rewardAssetId), IntegerEntry(keyRewardsTotal(programName), 0)], unit)
286291 else throw("Strict value is not equal to itself.")
287292 }
288293 else throw("Strict value is not equal to itself.")
289294 }
290295 else throw("Strict value is not equal to itself.")
291296 }
292297 else throw("Strict value is not equal to itself.")
293298 }
294299
295300
296301
297302 @Callable(i)
298303 func createPair (programName,referrerAddress,referralAddress,signature) = {
299304 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
300305 then true
301306 else throwErr("program does not exist")
302307 if ((checkProgramExists == checkProgramExists))
303308 then {
304309 let pairReferrerToReferralExistCheck = if ((getBoolean(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress)) == unit))
305310 then true
306311 else throwErr("pair already exists")
307312 if ((pairReferrerToReferralExistCheck == pairReferrerToReferralExistCheck))
308313 then {
309314 let noRefSelf = if ((referrerAddress != referralAddress))
310315 then true
311316 else throwErr("cannot refer to self")
312317 if ((noRefSelf == noRefSelf))
313318 then {
314319 let pair = toBytes(makeString([programName, referrerAddress, referralAddress], ":"))
315320 let backendPublicKey = fromBase58String(value(getString(keyBackendPublicKey)))
316321 let validateSignature = if (sigVerify(pair, signature, backendPublicKey))
317322 then true
318323 else throwErr("bad signature")
319324 if ((validateSignature == validateSignature))
320325 then {
321326 let totalReferralCount = valueOrElse(getInteger(keyTotalReferralCount(programName, referrerAddress)), 0)
322327 let newTotalReferralCount = (totalReferralCount + 1)
323328 let updatedAllReferrerPrograms = updateAllReferralPrograms(referrerAddress, programName)
324329 let updatedAllReferralPrograms = updateAllReferralPrograms(referralAddress, programName)
325330 $Tuple2((([BooleanEntry(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress), true), IntegerEntry(keyTotalReferralCount(programName, referrerAddress), newTotalReferralCount), StringEntry(keyReferrer(programName, referralAddress), referrerAddress)] ++ updatedAllReferrerPrograms) ++ updatedAllReferralPrograms), unit)
326331 }
327332 else throw("Strict value is not equal to itself.")
328333 }
329334 else throw("Strict value is not equal to itself.")
330335 }
331336 else throw("Strict value is not equal to itself.")
332337 }
333338 else throw("Strict value is not equal to itself.")
334339 }
335340
336341
337342
338343 @Callable(i)
339344 func updateReferralActivity (programName,referralAddress,isActive) = {
340345 let implementationContract = value(getString(keyImplementationContract(programName)))
341346 let isReferralActive = (getBoolean(keyIsReferralActive(programName, referralAddress)) != unit)
342347 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
343348 let checkCaller = if ((toString(i.caller) == implementationContract))
344349 then true
345350 else throwErr("permission denied")
346351 if ((checkCaller == checkCaller))
347352 then {
348353 let update = if ((isReferralActive == isActive))
349354 then $Tuple2(nil, unit)
350355 else {
351356 let update = if ((isActive == true))
352357 then {
353358 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) + 1)
354359 $Tuple2([BooleanEntry(keyIsReferralActive(programName, referralAddress), true), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
355360 }
356361 else {
357362 let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) - 1)
358363 $Tuple2([DeleteEntry(keyIsReferralActive(programName, referralAddress)), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit)
359364 }
360365 update
361366 }
362367 update
363368 }
364369 else throw("Strict value is not equal to itself.")
365370 }
366371
367372
368373
369374 @Callable(i)
370375 func incUnclaimed (programName,referralAddress,referrerReward,referralReward) = {
371376 let implementationContract = value(getString(keyImplementationContract(programName)))
372377 let referrerAddress = value(getString(keyReferrer(programName, referralAddress)))
373378 let checkCaller = if ((toString(i.caller) == implementationContract))
374379 then true
375380 else throwErr("permission denied")
376381 if ((checkCaller == checkCaller))
377382 then {
378383 let checkProgram = if ((programName == "wxlock"))
379384 then true
380385 else throwErr("invalid program")
381386 if ((checkProgram == checkProgram))
382387 then {
383388 let checkReferrerInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referrerAddress)), ""), programName))
384389 then true
385390 else throwErr(((("referrer not in program=" + programName) + " addr=") + referrerAddress))
386391 if ((checkReferrerInProgram == checkReferrerInProgram))
387392 then {
388393 let checkReferralInProgram = if (contains(valueOrElse(getString(keyAllReferralPrograms(referralAddress)), ""), programName))
389394 then true
390395 else throwErr(((("referral not in program=" + programName) + " addr=") + referralAddress))
391396 if ((checkReferralInProgram == checkReferralInProgram))
392397 then {
393398 let unclaimedTotalReferrer = valueOrElse(getInteger(keyUnclaimedTotalAddress(referrerAddress)), 0)
394399 let referrerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, referrerAddress)), 0)
395400 let unclaimedTotalReferral = valueOrElse(getInteger(keyUnclaimedTotalAddress(referralAddress)), 0)
396401 let referralUnclaimed = valueOrElse(getInteger(keyUnclaimedReferral(programName, referralAddress)), 0)
397402 let rewardsTotal = valueOrElse(getInteger(keyRewardsTotal(programName)), 0)
398403 let newUnclaimedTotalReferrer = (unclaimedTotalReferrer + referrerReward)
399404 let newReferrerUnclaimed = (referrerUnclaimed + referrerReward)
400405 let newUnclaimedTotalReferral = (unclaimedTotalReferral + referralReward)
401406 let newReferralUnclaimed = (referralUnclaimed + referralReward)
402407 $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)
403408 }
404409 else throw("Strict value is not equal to itself.")
405410 }
406411 else throw("Strict value is not equal to itself.")
407412 }
408413 else throw("Strict value is not equal to itself.")
409414 }
410415 else throw("Strict value is not equal to itself.")
411416 }
412417
413418
414419
415420 @Callable(i)
416421 func incUnclaimedWithPayment (programName,referrerAddresses) = {
417422 let checkProgram = if ((programName == "wxSpotFee"))
418423 then true
419424 else throwErr("invalid program")
420425 if ((checkProgram == checkProgram))
421426 then {
422427 func map (accum,next) = {
423428 let assetIdCheck = (toBase58String(value(next.assetId)) == value(getString(keyRewardAssetId(programName))))
424429 let amountCheck = if (assetIdCheck)
425430 then true
426431 else throwErr("invalid asset id")
427432 if ((amountCheck == amountCheck))
428433 then (accum :+ next.amount)
429434 else throw("Strict value is not equal to itself.")
430435 }
431436
432437 let payments = {
433438 let $l = i.payments
434439 let $s = size($l)
435440 let $acc0 = nil
436441 func $f0_1 ($a,$i) = if (($i >= $s))
437442 then $a
438443 else map($a, $l[$i])
439444
440445 func $f0_2 ($a,$i) = if (($i >= $s))
441446 then $a
442447 else throw("List size exceeds 10")
443448
444449 $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)
445450 }
446451 let resAmount = {
447452 let @ = invoke(this, "incUnclaimedWithPaymentInternal", [payments, programName, referrerAddresses, 0, 0], nil)
448453 if ($isInstanceOf(@, "Int"))
449454 then @
450455 else throw(($getType(@) + " couldn't be cast to Int"))
451456 }
452457 if ((resAmount == resAmount))
453458 then {
454459 let treasuryContract = addressFromStringValue(value(getString(keyTreasuryContract(programName))))
455460 let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName))))
456461 [ScriptTransfer(treasuryContract, resAmount, rewardAssetId)]
457462 }
458463 else throw("Strict value is not equal to itself.")
459464 }
460465 else throw("Strict value is not equal to itself.")
461466 }
462467
463468
464469
465470 @Callable(i)
466471 func claim (programName) = {
467472 let checkProgramExists = if (valueOrElse(getBoolean(keyProgramName(programName)), false))
468473 then true
469474 else throwErr("program does not exist")
470475 if ((checkProgramExists == checkProgramExists))
471476 then {
472477 let isImplementationContract = (toString(i.caller) == value(getString(keyImplementationContract(programName))))
473478 let claimerAddress = if (isImplementationContract)
474479 then toString(i.originCaller)
475480 else toString(i.caller)
476481 let claimInternal = invoke(this, "claimInternal", [programName, claimerAddress, isImplementationContract], nil)
477482 if ((claimInternal == claimInternal))
478483 then $Tuple2(nil, claimInternal)
479484 else throw("Strict value is not equal to itself.")
480485 }
481486 else throw("Strict value is not equal to itself.")
482487 }
483488
484489
485490
486491 @Callable(i)
487492 func claimBulk () = {
488493 let callerAddress = toString(i.caller)
489494 let callerProgramsStr = getString(keyAllReferralPrograms(toString(i.caller)))
490495 let programsExists = if (isDefined(callerProgramsStr))
491496 then true
492497 else throwErr("no referral programs")
493498 if ((programsExists == programsExists))
494499 then {
495500 let callerPrograms = split(value(callerProgramsStr), "__")
496501 let bulkClaim = invoke(this, "claimBulkInternal", [callerAddress, callerPrograms, 0], nil)
497502 if ((bulkClaim == bulkClaim))
498503 then $Tuple2(nil, bulkClaim)
499504 else throw("Strict value is not equal to itself.")
500505 }
501506 else throw("Strict value is not equal to itself.")
502507 }
503508
504509
505510
506511 @Callable(i)
507512 func claimREADONLY (programName,userAddress) = {
508513 let claimerClaimed = valueOrElse(getInteger(keyClaimedReferrer(programName, userAddress)), 0)
509514 let claimerUnclaimed = valueOrElse(getInteger(keyUnclaimedReferrer(programName, userAddress)), 0)
510515 $Tuple2(nil, [claimerUnclaimed, claimerClaimed])
511516 }
512517
513518
514519
515520 @Callable(i)
516521 func claimBulkREADONLY (claimer) = {
517522 let claimedTotalAddress = valueOrElse(getInteger(keyClaimedTotalAddress(claimer)), 0)
518523 let unclaimedTotalAddress = valueOrElse(getInteger(keyUnclaimedTotalAddress(claimer)), 0)
519524 $Tuple2(nil, [unclaimedTotalAddress, claimedTotalAddress])
520525 }
521526
522527
523528
524529 @Callable(i)
525530 func setTotalKeys (programName,address) = {
526531 let claimedReferrer = valueOrElse(getInteger(keyClaimedReferrer(programName, address)), 0)
527532 let claimedReferral = valueOrElse(getInteger(keyClaimedReferral(programName, address)), 0)
528533 let unclaimedReferrer = valueOrElse(getInteger(keyUnclaimedReferrer(programName, address)), 0)
529534 let unclaimedReferral = valueOrElse(getInteger(keyUnclaimedReferral(programName, address)), 0)
530535 let claimedTotalAddress = (claimedReferrer + claimedReferral)
531536 let unclaimedTotalAddress = (unclaimedReferrer + unclaimedReferral)
532537 $Tuple2([IntegerEntry(keyClaimedTotalAddress(address), claimedTotalAddress), IntegerEntry(keyUnclaimedTotalAddress(address), unclaimedTotalAddress)], unit)
533538 }
534539
535540
536541 @Verifier(tx)
537542 func verify () = {
538543 let targetPublicKey = match managerPublicKeyOrUnit() {
539544 case pk: ByteVector =>
540545 pk
541546 case _: Unit =>
542547 tx.senderPublicKey
543548 case _ =>
544549 throw("Match error")
545550 }
546551 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
547552 }
548553

github/deemru/w8io/169f3d6 
65.73 ms