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