tx · 5acnfoAU9CZCqooSmHi73jXLwaMraXiQBecBcKM6zvi7 3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh: -0.01400000 Waves 2022.07.26 18:46 [2156968] smart account 3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh > SELF 0.00000000 Waves
{ "type": 13, "id": "5acnfoAU9CZCqooSmHi73jXLwaMraXiQBecBcKM6zvi7", "fee": 1400000, "feeAssetId": null, "timestamp": 1658850398671, "version": 1, "sender": "3NAsFvuLwxz1iUtZ9fmhfmSN16r9NEsPqsh", "senderPublicKey": "33fpjdpM9FMu87RZKePniPardKqQXM96sm7VhAk3JEVQ", "proofs": [ "42Q6bDKx9cpTSYLt5jri1Qz2MmTJV5LR9MD1bzEWiPzwyzZpAAcrSoesVUJKKMiM3Qt9Dusdkrsrf3adrNBDUNPb" ], "script": "base64:BgIyCAISBQoDCAgIEgYKBAgICAISBQoDCAgEEgYKBAgIAQESAwoBCBIECgIICBIDCgEIEgAUAAlzZXBhcmF0b3ICAl9fABNrZXlCYWNrZW5kUHVibGljS2V5CQC5CQIJAMwIAgICJXMJAMwIAgIQYmFja2VuZFB1bGJpY0tleQUDbmlsBQlzZXBhcmF0b3IBG2tleUV4aXN0c1JlZmVycmVyVG9SZWZlcnJhbAMLcHJvZ3JhbU5hbWUPcmVmZXJyZXJBZGRyZXNzD3JlZmVycmFsQWRkcmVzcwkAuQkCCQDMCAICCCVzJXMlcyVzCQDMCAICGGV4aXN0c1JlZmVycmVyVG9SZWZlcnJhbAkAzAgCBQtwcm9ncmFtTmFtZQkAzAgCBQ9yZWZlcnJlckFkZHJlc3MJAMwIAgUPcmVmZXJyYWxBZGRyZXNzBQNuaWwFCXNlcGFyYXRvcgEKa2V5Q2xhaW1lZAILcHJvZ3JhbU5hbWUOY2xhaW1lckFkZHJlc3MJALkJAgkAzAgCAgglcyVzJXMlcwkAzAgCAgdjbGFpbWVkCQDMCAIFC3Byb2dyYW1OYW1lCQDMCAIFDmNsY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FuYWdlclB1YmxpY0tleU9yVW5pdAAEBWhhc1BNAwkBCWlzRGVmaW5lZAEFAnBtBgkBCHRocm93RXJyAQISbm8gcGVuZGluZyBtYW5hZ2VyAwkAAAIFBWhhc1BNBQVoYXNQTQQHY2hlY2tQTQMJAAACCAUBaQ9jYWxsZXJQdWJsaWNLZXkJAQV2YWx1ZQEFAnBtBgkBCHRocm93RXJyAQIbeW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAIFB2NoZWNrUE0FB2NoZWNrUE0JAMwIAgkBC1N0cmluZ0VudHJ5AgkBE2tleU1hbmFnZXJQdWJsaWNLZXkACQDYBAEJAQV2YWx1ZQEFAnBtCQDMCAIJAQtEZWxldGVFbnRyeQEJARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tlefYoILk=", "chainId": 84, "height": 2156968, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: Agy9bF4xqPBL3cMu2uDEkpo3LLg9xd5Lcda2KenXvhJk Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let separator = "__" | |
5 | + | ||
6 | + | let keyBackendPublicKey = makeString(["%s", "backendPulbicKey"], separator) | |
7 | + | ||
8 | + | func keyExistsReferrerToReferral (programName,referrerAddress,referralAddress) = makeString(["%s%s%s%s", "existsReferrerToReferral", programName, referrerAddress, referralAddress], separator) | |
9 | + | ||
10 | + | ||
11 | + | func keyClaimed (programName,claimerAddress) = makeString(["%s%s%s%s", "claimed", programName, claimerAddress], separator) | |
12 | + | ||
13 | + | ||
14 | + | func keyUnclaimed (programName,claimerAddress) = makeString(["%s%s%s%s", "unclaimed", programName, claimerAddress], separator) | |
15 | + | ||
16 | + | ||
17 | + | func keyReferrer (programName,referralAddress) = makeString(["%s%s%s", "referrer", programName, referralAddress], separator) | |
18 | + | ||
19 | + | ||
20 | + | func keyProgramName (programName) = makeString(["%s%s", "programName", programName], separator) | |
21 | + | ||
22 | + | ||
23 | + | func keyTotalReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "totalReferralCount", programName, referrerAddress], separator) | |
24 | + | ||
25 | + | ||
26 | + | func keyActiveReferralCount (programName,referrerAddress) = makeString(["%s%s%s", "activeReferralCount", programName, referrerAddress], separator) | |
27 | + | ||
28 | + | ||
29 | + | func keyIsReferralActive (programName,referralAddress) = makeString(["%s%s%s", "activeReferral", programName, referralAddress], separator) | |
30 | + | ||
31 | + | ||
32 | + | func keyClaimedTotal (programName) = makeString(["%s%s", "claimedTotal", programName], separator) | |
33 | + | ||
34 | + | ||
35 | + | func keyRewardAssetId (programName) = makeString(["%s%s", "rewardAssetId", programName], separator) | |
36 | + | ||
37 | + | ||
38 | + | func keyTreasuryContract (programName) = makeString(["%s%s", "treasuryContract", programName], separator) | |
39 | + | ||
40 | + | ||
41 | + | func keyImplementationContract (programName) = makeString(["%s%s", "implementationContract", programName], separator) | |
42 | + | ||
43 | + | ||
44 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
45 | + | ||
46 | + | ||
47 | + | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
48 | + | ||
49 | + | ||
50 | + | func throwErr (msg) = throw(makeString(["referral.ride:", msg], " ")) | |
51 | + | ||
52 | + | ||
53 | + | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
54 | + | case s: String => | |
55 | + | fromBase58String(s) | |
56 | + | case _: Unit => | |
57 | + | unit | |
58 | + | case _ => | |
59 | + | throw("Match error") | |
60 | + | } | |
61 | + | ||
62 | + | ||
63 | + | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
64 | + | case s: String => | |
65 | + | fromBase58String(s) | |
66 | + | case _: Unit => | |
67 | + | unit | |
68 | + | case _ => | |
69 | + | throw("Match error") | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | func mustManager (i) = { | |
74 | + | let pd = throwErr("permission denied") | |
75 | + | match managerPublicKeyOrUnit() { | |
76 | + | case pk: ByteVector => | |
77 | + | if ((i.callerPublicKey == pk)) | |
78 | + | then true | |
79 | + | else pd | |
80 | + | case _: Unit => | |
81 | + | if ((i.caller == this)) | |
82 | + | then true | |
83 | + | else pd | |
84 | + | case _ => | |
85 | + | throw("Match error") | |
86 | + | } | |
87 | + | } | |
88 | + | ||
89 | + | ||
90 | + | @Callable(i) | |
91 | + | func createReferralProgram (programName,treasuryContract,implementationContract) = { | |
92 | + | let checkCaller = mustManager(i) | |
93 | + | if ((checkCaller == checkCaller)) | |
94 | + | then { | |
95 | + | let checkProgramName = if ((getBoolean(programName) == true)) | |
96 | + | then true | |
97 | + | else throwErr("program name already exists") | |
98 | + | if ((checkProgramName == checkProgramName)) | |
99 | + | then $Tuple2([BooleanEntry(keyProgramName(programName), true), StringEntry(keyTreasuryContract(programName), treasuryContract), StringEntry(keyImplementationContract(programName), implementationContract)], unit) | |
100 | + | else throw("Strict value is not equal to itself.") | |
101 | + | } | |
102 | + | else throw("Strict value is not equal to itself.") | |
103 | + | } | |
104 | + | ||
105 | + | ||
106 | + | ||
107 | + | @Callable(i) | |
108 | + | func createPair (programName,referrerAddress,referralAddress,signature) = { | |
109 | + | let pairReferrerToReferralExistCheck = if ((getString(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress)) == unit)) | |
110 | + | then true | |
111 | + | else throwErr("pair already exists") | |
112 | + | if ((pairReferrerToReferralExistCheck == pairReferrerToReferralExistCheck)) | |
113 | + | then { | |
114 | + | let pair = toBytes(makeString([programName, referrerAddress, referralAddress], ":")) | |
115 | + | let backendPublicKey = toBytes(value(getString(keyBackendPublicKey))) | |
116 | + | let validateSignature = if (sigVerify(pair, signature, backendPublicKey)) | |
117 | + | then true | |
118 | + | else throwErr("bad signature") | |
119 | + | if ((validateSignature == validateSignature)) | |
120 | + | then { | |
121 | + | let totalReferralCount = valueOrElse(getInteger(keyTotalReferralCount(programName, referrerAddress)), 0) | |
122 | + | let newTotalReferralCount = (totalReferralCount + 1) | |
123 | + | $Tuple2([BooleanEntry(keyExistsReferrerToReferral(programName, referrerAddress, referralAddress), true), IntegerEntry(keyTotalReferralCount(programName, referrerAddress), newTotalReferralCount)], unit) | |
124 | + | } | |
125 | + | else throw("Strict value is not equal to itself.") | |
126 | + | } | |
127 | + | else throw("Strict value is not equal to itself.") | |
128 | + | } | |
129 | + | ||
130 | + | ||
131 | + | ||
132 | + | @Callable(i) | |
133 | + | func updateReferralActivity (programName,referralAddress,isActive) = { | |
134 | + | let implementationContract = value(getString(keyImplementationContract(programName))) | |
135 | + | let isReferralActive = (getBoolean(keyIsReferralActive(programName, referralAddress)) != unit) | |
136 | + | let referrerAddress = value(getString(keyReferrer(programName, referralAddress))) | |
137 | + | let checkCaller = if ((toString(i.caller) == implementationContract)) | |
138 | + | then true | |
139 | + | else throwErr("permission denied") | |
140 | + | if ((checkCaller == checkCaller)) | |
141 | + | then { | |
142 | + | let update = if ((isReferralActive == isActive)) | |
143 | + | then $Tuple2(nil, unit) | |
144 | + | else { | |
145 | + | let update = if ((isActive == true)) | |
146 | + | then { | |
147 | + | let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) + 1) | |
148 | + | $Tuple2([BooleanEntry(keyIsReferralActive(programName, referralAddress), true), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit) | |
149 | + | } | |
150 | + | else { | |
151 | + | let newActiveReferralCount = (valueOrElse(getInteger(keyActiveReferralCount(programName, referrerAddress)), 0) - 1) | |
152 | + | $Tuple2([DeleteEntry(keyIsReferralActive(programName, referralAddress)), IntegerEntry(keyActiveReferralCount(programName, referrerAddress), newActiveReferralCount)], unit) | |
153 | + | } | |
154 | + | update | |
155 | + | } | |
156 | + | update | |
157 | + | } | |
158 | + | else throw("Strict value is not equal to itself.") | |
159 | + | } | |
160 | + | ||
161 | + | ||
162 | + | ||
163 | + | @Callable(i) | |
164 | + | func incUnclaimed (programName,referralAddress,referrerReward,referralReward) = { | |
165 | + | let implementationContract = value(getString(keyImplementationContract(programName))) | |
166 | + | let checkCaller = if ((toString(i.caller) == implementationContract)) | |
167 | + | then true | |
168 | + | else throwErr("permission denied") | |
169 | + | if ((checkCaller == checkCaller)) | |
170 | + | then { | |
171 | + | let referrerAddress = value(getString(keyReferrer(programName, referralAddress))) | |
172 | + | let referrerUnclaimed = value(getInteger(keyUnclaimed(programName, referrerAddress))) | |
173 | + | let referralUnclaimed = value(getInteger(keyUnclaimed(programName, referralAddress))) | |
174 | + | let newReferrerUnclaimed = (referrerUnclaimed + referrerReward) | |
175 | + | let newReferralUnclaimed = (referralUnclaimed + referralReward) | |
176 | + | $Tuple2([IntegerEntry(keyClaimed(programName, referralAddress), newReferrerUnclaimed), IntegerEntry(keyUnclaimed(programName, referralAddress), newReferralUnclaimed)], unit) | |
177 | + | } | |
178 | + | else throw("Strict value is not equal to itself.") | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | @Callable(i) | |
184 | + | func claim (programName) = { | |
185 | + | let claimedTotal = value(getInteger(keyClaimedTotal(programName))) | |
186 | + | let claimerClaimed = value(getInteger(keyClaimed(programName, toString(i.caller)))) | |
187 | + | let claimerUnclaimed = value(getInteger(keyUnclaimed(programName, toString(i.caller)))) | |
188 | + | let treasuryContract = value(addressFromString(value(getString(keyTreasuryContract(programName))))) | |
189 | + | let rewardAssetId = fromBase58String(value(getString(keyRewardAssetId(programName)))) | |
190 | + | let checkCanClaim = if ((claimerUnclaimed > 0)) | |
191 | + | then true | |
192 | + | else throwErr("nothing to claim") | |
193 | + | if ((checkCanClaim == checkCanClaim)) | |
194 | + | then { | |
195 | + | let newClaimerClaimed = (claimerClaimed + claimerUnclaimed) | |
196 | + | let newClaimedTotal = (claimedTotal + claimerUnclaimed) | |
197 | + | let balanceBefore = value(assetBalance(this, rewardAssetId)) | |
198 | + | if ((balanceBefore == balanceBefore)) | |
199 | + | then { | |
200 | + | let res = invoke(treasuryContract, "withdrawReferralReward", [claimerUnclaimed], nil) | |
201 | + | if ((res == res)) | |
202 | + | then { | |
203 | + | let balanceAfter = value(assetBalance(this, rewardAssetId)) | |
204 | + | if ((balanceAfter == balanceAfter)) | |
205 | + | then { | |
206 | + | let balanceDiff = (balanceAfter - balanceBefore) | |
207 | + | if ((balanceDiff == balanceDiff)) | |
208 | + | then { | |
209 | + | let checkBalance = if ((balanceDiff == claimerUnclaimed)) | |
210 | + | then true | |
211 | + | else throwErr("insufficient balance on referral contract") | |
212 | + | if ((checkBalance == checkBalance)) | |
213 | + | then $Tuple2([IntegerEntry(keyClaimed(programName, toString(i.caller)), newClaimerClaimed), IntegerEntry(keyClaimedTotal(programName), newClaimedTotal), IntegerEntry(keyUnclaimed(programName, toString(i.caller)), 0), ScriptTransfer(i.caller, claimerUnclaimed, rewardAssetId)], unit) | |
214 | + | else throw("Strict value is not equal to itself.") | |
215 | + | } | |
216 | + | else throw("Strict value is not equal to itself.") | |
217 | + | } | |
218 | + | else throw("Strict value is not equal to itself.") | |
219 | + | } | |
220 | + | else throw("Strict value is not equal to itself.") | |
221 | + | } | |
222 | + | else throw("Strict value is not equal to itself.") | |
223 | + | } | |
224 | + | else throw("Strict value is not equal to itself.") | |
225 | + | } | |
226 | + | ||
227 | + | ||
228 | + | ||
229 | + | @Callable(i) | |
230 | + | func claimREADONLY (programName,referralAddress) = { | |
231 | + | let claimerClaimed = value(getInteger(keyClaimed(programName, referralAddress))) | |
232 | + | let claimerUnclaimed = value(getInteger(keyUnclaimed(programName, referralAddress))) | |
233 | + | let newClaimerClaimed = (claimerClaimed + claimerUnclaimed) | |
234 | + | $Tuple2(nil, newClaimerClaimed) | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | ||
239 | + | @Callable(i) | |
240 | + | func setManager (pendingManagerPublicKey) = { | |
241 | + | let checkCaller = mustManager(i) | |
242 | + | if ((checkCaller == checkCaller)) | |
243 | + | then { | |
244 | + | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
245 | + | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
246 | + | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
247 | + | else throw("Strict value is not equal to itself.") | |
248 | + | } | |
249 | + | else throw("Strict value is not equal to itself.") | |
250 | + | } | |
251 | + | ||
252 | + | ||
253 | + | ||
254 | + | @Callable(i) | |
255 | + | func confirmManager () = { | |
256 | + | let pm = pendingManagerPublicKeyOrUnit() | |
257 | + | let hasPM = if (isDefined(pm)) | |
258 | + | then true | |
259 | + | else throwErr("no pending manager") | |
260 | + | if ((hasPM == hasPM)) | |
261 | + | then { | |
262 | + | let checkPM = if ((i.callerPublicKey == value(pm))) | |
263 | + | then true | |
264 | + | else throwErr("you are not pending manager") | |
265 | + | if ((checkPM == checkPM)) | |
266 | + | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
267 | + | else throw("Strict value is not equal to itself.") | |
268 | + | } | |
269 | + | else throw("Strict value is not equal to itself.") | |
270 | + | } | |
271 | + | ||
272 | + | ||
273 | + | @Verifier(tx) | |
274 | + | func verify () = { | |
275 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
276 | + | case pk: ByteVector => | |
277 | + | pk | |
278 | + | case _: Unit => | |
279 | + | tx.senderPublicKey | |
280 | + | case _ => | |
281 | + | throw("Match error") | |
282 | + | } | |
283 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
284 | + | } | |
285 | + |
github/deemru/w8io/026f985 42.40 ms ◑