tx · Cw7BCCRcxuaMyvqqKr2JhRr6h46cHyrHiNWBnAtFHTrb 3Moxfr1c53DJoiy5eHzocn6PRWkSng4QGt5: -0.01700000 Waves 2024.10.07 20:24 [3316719] smart account 3Moxfr1c53DJoiy5eHzocn6PRWkSng4QGt5 > SELF 0.00000000 Waves
{ "type": 13, "id": "Cw7BCCRcxuaMyvqqKr2JhRr6h46cHyrHiNWBnAtFHTrb", "fee": 1700000, "feeAssetId": null, "timestamp": 1728321907486, "version": 2, "chainId": 84, "sender": "3Moxfr1c53DJoiy5eHzocn6PRWkSng4QGt5", "senderPublicKey": "BU8rYtii1aJGQdtENyW49QRU4HmzRBrG7fKheSLpaCkk", "proofs": [ "4xTfYkzYbL4iaUYa2AYU43E2L7PKRxx5vk5CwjffExUvfvCMkPbtM1HhQmdyB3VwRSxPqxoGbymEve5fYUpPEAAm" ], "script": "base64:BgI8CAISAwoBCBIGCgQICAgIEgMKAQgSABIAEgMKAQgSABIDCgEIEgMKAQgSBAoCCAgSAwoBCBIGCgQIAQQIOAENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAEVa2V5RHVja1BsYXlVbmxvY2tUaW1lAQdhc3NldElkCQCsAgIJAKwCAgIFZHVja18JANgEAQUHYXNzZXRJZAILX3VubG9ja1RpbWUBF2tleUR1Y2tGaW5pc2hVbmxvY2tUaW1lAQdhc3NldElkCQCsAgIJAKwCAgIFZHVja18JANgEAQUHYXNzZXRJZAIRZmluaXNoX3VubG9ja1RpbWUBDGtleUR1Y2tPd25lcgEHYXNzZXRJZAkArAICCQCsAgICBWR1Y2tfCQDYBAEFB2Fzc2V0SWQCBl9vd25lcgEOa2V5U3BvdHNCb3VnaHQBCmFkZHJlc3NTdHIJAKwCAgkArAICAghhZGRyZXNzXwUKYWRkcmVzc1N0cgIMX3Nwb3RzQm91Z2h0AQxrZXlTcG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Fja2VuZCBrZXkJANgEAQkBEGdldEJhY2tlbmRQdWJLZXkAAgEgBQR0ZXh0BAx2YWxpZFBheW1lbnQJARZjaGVja0FkZGl0aW9uYWxQYXltZW50AQkAkQMCCAUBaQhwYXltZW50cwAAAwkAAAIFDHZhbGlkUGF5bWVudAUMdmFsaWRQYXltZW50CQDOCAIJAQt1bnN0YWtlRHVjawMFCmFzc2V0SWRTdHIFCmFkZHJlc3NTdHIFCmFkZHJlc3NTdHIFDHZhbGlkUGF5bWVudAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgA+YhOg", "height": 3316719, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 3GKwvh5zpe41p2XPgkGaCDGvDvZdGqTy2ASvNZhe6oNy Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
5 | + | case b: Int => | |
6 | + | b | |
7 | + | case _ => | |
8 | + | 0 | |
9 | + | } | |
10 | + | ||
11 | + | ||
12 | + | func keyDuckPlayUnlockTime (assetId) = (("duck_" + toBase58String(assetId)) + "_unlockTime") | |
13 | + | ||
14 | + | ||
15 | + | func keyDuckFinishUnlockTime (assetId) = (("duck_" + toBase58String(assetId)) + "finish_unlockTime") | |
16 | + | ||
17 | + | ||
18 | + | func keyDuckOwner (assetId) = (("duck_" + toBase58String(assetId)) + "_owner") | |
19 | + | ||
20 | + | ||
21 | + | func keySpotsBought (addressStr) = (("address_" + addressStr) + "_spotsBought") | |
22 | + | ||
23 | + | ||
24 | + | func keySpotsBusy (addressStr) = (("address_" + addressStr) + "_spotsBusy") | |
25 | + | ||
26 | + | ||
27 | + | func keyLockedDuckStatus (addressStr,assetIdStr) = (((("address_" + addressStr) + "_lockedDuck_") + assetIdStr) + "_status") | |
28 | + | ||
29 | + | ||
30 | + | func keyDuckV2 (addressStr,assetIdStr) = (((("address_" + addressStr) + "_lockedDuck_") + assetIdStr) + "_v2") | |
31 | + | ||
32 | + | ||
33 | + | func getDuckDetails (assetId) = { | |
34 | + | let assetName = value(value(assetInfo(assetId)).name) | |
35 | + | let assetNameParts = split(assetName, "") | |
36 | + | let isJackpot = (assetNameParts[(size(assetNameParts) - 2)] == "J") | |
37 | + | let assetColor = if (isJackpot) | |
38 | + | then "B" | |
39 | + | else assetNameParts[(size(assetNameParts) - 1)] | |
40 | + | $Tuple2(assetColor, isJackpot) | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | func tryGetStringExternal (address,key) = match getString(address, key) { | |
45 | + | case a: String => | |
46 | + | a | |
47 | + | case _ => | |
48 | + | "" | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | func tryGetBoolean (key) = match getBoolean(key) { | |
53 | + | case b: Boolean => | |
54 | + | b | |
55 | + | case _ => | |
56 | + | false | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | func tryGetString (key) = tryGetStringExternal(this, key) | |
61 | + | ||
62 | + | ||
63 | + | func staticKey_oracleAddress () = "static_oracleAddress" | |
64 | + | ||
65 | + | ||
66 | + | func staticKey_eggAssetId () = "static_eggAssetId" | |
67 | + | ||
68 | + | ||
69 | + | func staticKey_incubatorAddress () = "static_incubatorAddress" | |
70 | + | ||
71 | + | ||
72 | + | func staticKey_breederAddress () = "static_breederAddress" | |
73 | + | ||
74 | + | ||
75 | + | func staticKey_farmingAddress () = "static_farmingAddress" | |
76 | + | ||
77 | + | ||
78 | + | func staticKey_rentingAddress () = "static_rentingAddress" | |
79 | + | ||
80 | + | ||
81 | + | func staticKey_shortGameName () = "static_shortGameName" | |
82 | + | ||
83 | + | ||
84 | + | func staticKey_longGameName () = "static_longGameName" | |
85 | + | ||
86 | + | ||
87 | + | func staticKey_nftName () = "static_nftName" | |
88 | + | ||
89 | + | ||
90 | + | func staticKey_backendPubKey () = "static_backendPubKey" | |
91 | + | ||
92 | + | ||
93 | + | func staticKey_accessItemAssetId () = "static_accessItemAssetId" | |
94 | + | ||
95 | + | ||
96 | + | func staticKey_accessItemPrice () = "static_accessItemPrice" | |
97 | + | ||
98 | + | ||
99 | + | func staticKey_minLockDuration () = "static_minLockDuration" | |
100 | + | ||
101 | + | ||
102 | + | func staticKey_UnlockDuration () = "static_UnlockDuration" | |
103 | + | ||
104 | + | ||
105 | + | func staticKey_boosterBuyAssetId () = "static_boosterBuyAssetId" | |
106 | + | ||
107 | + | ||
108 | + | func staticKey_extraFee () = "static_extraFee" | |
109 | + | ||
110 | + | ||
111 | + | func staticKey_feeAggregator () = "static_feeAggregator" | |
112 | + | ||
113 | + | ||
114 | + | func staticKey_boosterPriceLevel (level) = ("static_boosterPriceLevel_" + level) | |
115 | + | ||
116 | + | ||
117 | + | func staticKey_boosterName (level) = ("static_boosterName_" + level) | |
118 | + | ||
119 | + | ||
120 | + | func staticKey_burnAddress () = "static_burnAddress" | |
121 | + | ||
122 | + | ||
123 | + | func getOracle () = Address(fromBase58String(tryGetString(staticKey_oracleAddress()))) | |
124 | + | ||
125 | + | ||
126 | + | func getGameName () = valueOrErrorMessage(getString(staticKey_shortGameName()), "3GGN: There is no game name defined!") | |
127 | + | ||
128 | + | ||
129 | + | func getLongGameName () = valueOrErrorMessage(getString(staticKey_longGameName()), "3GLGN: There is no long game name defined!") | |
130 | + | ||
131 | + | ||
132 | + | func getNFTName () = valueOrErrorMessage(getString(staticKey_nftName()), "3GNN: There is no nft name defined!") | |
133 | + | ||
134 | + | ||
135 | + | func getIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_incubatorAddress()))) | |
136 | + | ||
137 | + | ||
138 | + | func getBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_breederAddress()))) | |
139 | + | ||
140 | + | ||
141 | + | func getRentingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_rentingAddress()))) | |
142 | + | ||
143 | + | ||
144 | + | func getFarmingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_farmingAddress()))) | |
145 | + | ||
146 | + | ||
147 | + | func getEggAssetId () = fromBase58String(tryGetStringExternal(getOracle(), staticKey_eggAssetId())) | |
148 | + | ||
149 | + | ||
150 | + | func getBackendPubKey () = fromBase58String(tryGetStringExternal(getOracle(), staticKey_backendPubKey())) | |
151 | + | ||
152 | + | ||
153 | + | func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator()))) | |
154 | + | ||
155 | + | ||
156 | + | func getBurnAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_burnAddress()))) | |
157 | + | ||
158 | + | ||
159 | + | func getAccessItemAssetId () = fromBase58String(tryGetString(staticKey_accessItemAssetId())) | |
160 | + | ||
161 | + | ||
162 | + | func getAccessItemPrice () = tryGetInteger(staticKey_accessItemPrice()) | |
163 | + | ||
164 | + | ||
165 | + | func getMinLockDuration () = tryGetInteger(staticKey_minLockDuration()) | |
166 | + | ||
167 | + | ||
168 | + | func getUnlockDuration () = tryGetInteger(staticKey_UnlockDuration()) | |
169 | + | ||
170 | + | ||
171 | + | func getBosterBuyAssetId () = fromBase58String(tryGetString(staticKey_boosterBuyAssetId())) | |
172 | + | ||
173 | + | ||
174 | + | func getBosterPriceForLevel (level) = valueOrErrorMessage(getInteger(staticKey_boosterPriceLevel(toString(level))), "3GBPFL: There is no price value for this level of booster") | |
175 | + | ||
176 | + | ||
177 | + | func getBosterNameForLevel (level) = valueOrErrorMessage(getString(staticKey_boosterName(toString(level))), "3GBNFL: There is no such booster") | |
178 | + | ||
179 | + | ||
180 | + | func checkAdditionalPayment (payment) = if (isDefined(payment.assetId)) | |
181 | + | then throw("RCAP: Please attach waves") | |
182 | + | else { | |
183 | + | let feeAmount = getIntegerValue(getOracle(), staticKey_extraFee()) | |
184 | + | if ((payment.amount != feeAmount)) | |
185 | + | then throw((("RCAP: Please attach exactly " + toString(feeAmount)) + " amount of wavelets")) | |
186 | + | else [ScriptTransfer(getFeeAggregator(), feeAmount, unit)] | |
187 | + | } | |
188 | + | ||
189 | + | ||
190 | + | func asString (value) = match value { | |
191 | + | case string: String => | |
192 | + | string | |
193 | + | case _ => | |
194 | + | throw("3AS: wrong type, expected: String") | |
195 | + | } | |
196 | + | ||
197 | + | ||
198 | + | func lockDuckInternal (addressStr,takeSpotsFrom,pmt) = { | |
199 | + | let assetId = value(pmt.assetId) | |
200 | + | let assetIssuer = value(assetInfo(assetId)).issuer | |
201 | + | let tDuckDetails = getDuckDetails(assetId) | |
202 | + | let assetColor = tDuckDetails._1 | |
203 | + | let isJackpot = tDuckDetails._2 | |
204 | + | let kSpotsBusy = keySpotsBusy(takeSpotsFrom) | |
205 | + | let spotsBusy = tryGetInteger(kSpotsBusy) | |
206 | + | let kSpotsBought = keySpotsBought(takeSpotsFrom) | |
207 | + | let addressSpotsAvailable = (tryGetInteger(kSpotsBought) - spotsBusy) | |
208 | + | if ((pmt.amount != 1)) | |
209 | + | then throw("NFT is not attached") | |
210 | + | else if (if ((assetIssuer != getIncubatorAddress())) | |
211 | + | then (assetIssuer != getBreederAddress()) | |
212 | + | else false) | |
213 | + | then throw("ivalid NFT attached") | |
214 | + | else if ((0 >= addressSpotsAvailable)) | |
215 | + | then throw(("No spots available in hunt for: " + takeSpotsFrom)) | |
216 | + | else { | |
217 | + | let kPerchesAvailable = ((("address_" + toString(this)) + "_perchesAvailable_") + assetColor) | |
218 | + | let perchesAvailable = match getInteger(getFarmingAddress(), kPerchesAvailable) { | |
219 | + | case b: Int => | |
220 | + | b | |
221 | + | case _ => | |
222 | + | 0 | |
223 | + | } | |
224 | + | if ((perchesAvailable == perchesAvailable)) | |
225 | + | then { | |
226 | + | let eggAssetId = getEggAssetId() | |
227 | + | [IntegerEntry(kSpotsBusy, (spotsBusy + 1)), StringEntry(keyDuckOwner(assetId), addressStr), BooleanEntry(keyLockedDuckStatus(addressStr, toBase58String(assetId)), true), IntegerEntry(keyDuckPlayUnlockTime(assetId), (lastBlock.timestamp + getMinLockDuration())), BooleanEntry(keyDuckV2(addressStr, toBase58String(assetId)), true)] | |
228 | + | } | |
229 | + | else throw("Strict value is not equal to itself.") | |
230 | + | } | |
231 | + | } | |
232 | + | ||
233 | + | ||
234 | + | func initUnlockDuck (assetIdStr,addressStr) = { | |
235 | + | let assetId = fromBase58String(assetIdStr) | |
236 | + | let tDuckDetails = getDuckDetails(assetId) | |
237 | + | let assetColor = tDuckDetails._1 | |
238 | + | let isJackpot = tDuckDetails._2 | |
239 | + | let kSpotsBusy = keySpotsBusy(addressStr) | |
240 | + | let kDuckOwner = keyDuckOwner(assetId) | |
241 | + | let remainingForUnlock = (tryGetInteger(keyDuckPlayUnlockTime(assetId)) - lastBlock.timestamp) | |
242 | + | if ((tryGetString(kDuckOwner) != addressStr)) | |
243 | + | then throw("3IULD: The duck is not yours") | |
244 | + | else if ((remainingForUnlock > 0)) | |
245 | + | then throw((("3IUL: You need to wait to unlock " + toString((remainingForUnlock / 1000))) + " seconds")) | |
246 | + | else [IntegerEntry(keyDuckFinishUnlockTime(assetId), (lastBlock.timestamp + getUnlockDuration()))] | |
247 | + | } | |
248 | + | ||
249 | + | ||
250 | + | func unstakeDuck (assetIdStr,addressStr,addSpotsTowards) = { | |
251 | + | let assetId = fromBase58String(assetIdStr) | |
252 | + | let tDuckDetails = getDuckDetails(assetId) | |
253 | + | let assetColor = tDuckDetails._1 | |
254 | + | let isJackpot = tDuckDetails._2 | |
255 | + | let kSpotsBusy = keySpotsBusy(addSpotsTowards) | |
256 | + | let kDuckOwner = keyDuckOwner(assetId) | |
257 | + | let remainingForUnlock = (tryGetInteger(keyDuckFinishUnlockTime(assetId)) - lastBlock.timestamp) | |
258 | + | if ((tryGetString(kDuckOwner) != addressStr)) | |
259 | + | then throw("3UD: The duck is not yours") | |
260 | + | else if ((remainingForUnlock > 0)) | |
261 | + | then throw((("3UD: You need to wait to unlock " + toString((remainingForUnlock / 1000))) + " seconds")) | |
262 | + | else [ScriptTransfer(Address(fromBase58String(addressStr)), 1, assetId), DeleteEntry(keyLockedDuckStatus(addressStr, assetIdStr)), DeleteEntry(kDuckOwner), IntegerEntry(kSpotsBusy, (tryGetInteger(kSpotsBusy) - 1))] | |
263 | + | } | |
264 | + | ||
265 | + | ||
266 | + | @Callable(i) | |
267 | + | func buyAccessItemInternal (addressStr) = if ((i.caller != this)) | |
268 | + | then throw("3BAII: internal use only") | |
269 | + | else { | |
270 | + | let issueAccessItem = Issue(("ACCESS-" + getGameName()), ((("[Access] " + getLongGameName()) + " access NFT for ") + getNFTName()), 1, 0, false) | |
271 | + | let accessRaceAssetId = toBase58String(calculateAssetId(issueAccessItem)) | |
272 | + | let kSpotsBought = keySpotsBought(addressStr) | |
273 | + | $Tuple2([issueAccessItem, StringEntry((("accessItem_" + accessRaceAssetId) + "_owner"), addressStr), StringEntry((("address_" + addressStr) + "_owning"), accessRaceAssetId), IntegerEntry(kSpotsBought, (tryGetInteger(kSpotsBought) + 1))], accessRaceAssetId) | |
274 | + | } | |
275 | + | ||
276 | + | ||
277 | + | ||
278 | + | @Callable(i) | |
279 | + | func configureOracle (oracle,shortname,longname,nftName) = if ((i.caller != this)) | |
280 | + | then throw("3CO: admin only") | |
281 | + | else [StringEntry("static_oracleAddress", oracle), StringEntry("static_shortGameName", shortname), StringEntry("static_longGameName", longname), StringEntry("static_nftName", nftName)] | |
282 | + | ||
283 | + | ||
284 | + | ||
285 | + | @Callable(i) | |
286 | + | func deleteSetting (key) = if ((i.caller != this)) | |
287 | + | then throw("3DS: Only administrator can call this method") | |
288 | + | else [DeleteEntry(key)] | |
289 | + | ||
290 | + | ||
291 | + | ||
292 | + | @Callable(i) | |
293 | + | func buyAccessItemAndLockDuck () = { | |
294 | + | let eggPayment = value(i.payments[0]) | |
295 | + | let duckPayment = value(i.payments[1]) | |
296 | + | let addressStr = toString(i.originCaller) | |
297 | + | if ((eggPayment.assetId != getAccessItemAssetId())) | |
298 | + | then throw("3BAI: Wrong asset attached") | |
299 | + | else if ((eggPayment.amount != getAccessItemPrice())) | |
300 | + | then throw("3BAI: Wrong amount of assets attached") | |
301 | + | else { | |
302 | + | let accessItemData = asString(invoke(this, "buyAccessItemInternal", [addressStr], nil)) | |
303 | + | if ((accessItemData == accessItemData)) | |
304 | + | then { | |
305 | + | let burnCall = invoke(getBurnAddress(), "burnAttachedPayments", nil, [AttachedPayment(getEggAssetId(), eggPayment.amount)]) | |
306 | + | if ((burnCall == burnCall)) | |
307 | + | then { | |
308 | + | let validPayment = if ((i.caller == getRentingAddress())) | |
309 | + | then nil | |
310 | + | else checkAdditionalPayment(i.payments[2]) | |
311 | + | if ((validPayment == validPayment)) | |
312 | + | then { | |
313 | + | let lockData = (lockDuckInternal(addressStr, addressStr, duckPayment) ++ validPayment) | |
314 | + | $Tuple2(lockData, accessItemData) | |
315 | + | } | |
316 | + | else throw("Strict value is not equal to itself.") | |
317 | + | } | |
318 | + | else throw("Strict value is not equal to itself.") | |
319 | + | } | |
320 | + | else throw("Strict value is not equal to itself.") | |
321 | + | } | |
322 | + | } | |
323 | + | ||
324 | + | ||
325 | + | ||
326 | + | @Callable(i) | |
327 | + | func buyAccessItem () = { | |
328 | + | let addressStr = toString(i.originCaller) | |
329 | + | let eggPayment = value(i.payments[0]) | |
330 | + | if ((eggPayment.assetId != getAccessItemAssetId())) | |
331 | + | then throw(("3BAI: Wrong asset attached " + toBase58String(getAccessItemAssetId()))) | |
332 | + | else if ((eggPayment.amount != getAccessItemPrice())) | |
333 | + | then throw("3BAI: Wrong amount of assets attached") | |
334 | + | else { | |
335 | + | let accessItemData = asString(invoke(this, "buyAccessItemInternal", [addressStr], nil)) | |
336 | + | if ((accessItemData == accessItemData)) | |
337 | + | then { | |
338 | + | let burnCall = invoke(getBurnAddress(), "burnAttachedPayments", nil, [AttachedPayment(getEggAssetId(), eggPayment.amount)]) | |
339 | + | if ((burnCall == burnCall)) | |
340 | + | then { | |
341 | + | let validPayment = if ((i.caller == getRentingAddress())) | |
342 | + | then nil | |
343 | + | else checkAdditionalPayment(i.payments[1]) | |
344 | + | if ((validPayment == validPayment)) | |
345 | + | then $Tuple2(validPayment, accessItemData) | |
346 | + | else throw("Strict value is not equal to itself.") | |
347 | + | } | |
348 | + | else throw("Strict value is not equal to itself.") | |
349 | + | } | |
350 | + | else throw("Strict value is not equal to itself.") | |
351 | + | } | |
352 | + | } | |
353 | + | ||
354 | + | ||
355 | + | ||
356 | + | @Callable(i) | |
357 | + | func buyAccessItemOther (addressOther) = { | |
358 | + | let eggPayment = value(i.payments[0]) | |
359 | + | if ((eggPayment.assetId != getAccessItemAssetId())) | |
360 | + | then throw("3BAI: Wrong asset attached") | |
361 | + | else if ((eggPayment.amount != getAccessItemPrice())) | |
362 | + | then throw("3BAI: Wrong amount of assets attached") | |
363 | + | else { | |
364 | + | let accessItemData = asString(invoke(this, "buyAccessItemInternal", [addressOther], nil)) | |
365 | + | if ((accessItemData == accessItemData)) | |
366 | + | then { | |
367 | + | let burnCall = invoke(getBurnAddress(), "burnAttachedPayments", nil, [AttachedPayment(getEggAssetId(), eggPayment.amount)]) | |
368 | + | if ((burnCall == burnCall)) | |
369 | + | then $Tuple2(nil, accessItemData) | |
370 | + | else throw("Strict value is not equal to itself.") | |
371 | + | } | |
372 | + | else throw("Strict value is not equal to itself.") | |
373 | + | } | |
374 | + | } | |
375 | + | ||
376 | + | ||
377 | + | ||
378 | + | @Callable(i) | |
379 | + | func lockDuck () = { | |
380 | + | let addressStr = toString(i.originCaller) | |
381 | + | let duckPayment = value(i.payments[0]) | |
382 | + | let validPayment = checkAdditionalPayment(i.payments[1]) | |
383 | + | if ((validPayment == validPayment)) | |
384 | + | then (lockDuckInternal(addressStr, addressStr, duckPayment) ++ validPayment) | |
385 | + | else throw("Strict value is not equal to itself.") | |
386 | + | } | |
387 | + | ||
388 | + | ||
389 | + | ||
390 | + | @Callable(i) | |
391 | + | func initUnlock (assetIdStr) = { | |
392 | + | let addressStr = toString(i.caller) | |
393 | + | let validPayment = checkAdditionalPayment(i.payments[0]) | |
394 | + | if ((validPayment == validPayment)) | |
395 | + | then (initUnlockDuck(assetIdStr, addressStr) ++ validPayment) | |
396 | + | else throw("Strict value is not equal to itself.") | |
397 | + | } | |
398 | + | ||
399 | + | ||
400 | + | ||
401 | + | @Callable(i) | |
402 | + | func lockDuckRenting (addressTakeSpotsFrom) = if ((i.caller != getRentingAddress())) | |
403 | + | then throw("3UDO: Renting only!") | |
404 | + | else { | |
405 | + | let addressStr = toString(i.caller) | |
406 | + | let duckPayment = value(i.payments[0]) | |
407 | + | lockDuckInternal(addressStr, addressTakeSpotsFrom, duckPayment) | |
408 | + | } | |
409 | + | ||
410 | + | ||
411 | + | ||
412 | + | @Callable(i) | |
413 | + | func unlockDuckRenting (assetIdStr,addSpotsTowards) = if ((i.caller != getRentingAddress())) | |
414 | + | then throw("3UDO: Renting only!") | |
415 | + | else { | |
416 | + | let addressStr = toString(i.caller) | |
417 | + | unstakeDuck(assetIdStr, addressStr, addSpotsTowards) | |
418 | + | } | |
419 | + | ||
420 | + | ||
421 | + | ||
422 | + | @Callable(i) | |
423 | + | func unlockDuckOther (assetIdStr) = if ((i.caller != this)) | |
424 | + | then throw("3UDO: Admin only!") | |
425 | + | else { | |
426 | + | let ownerKey = tryGetString(keyDuckOwner(fromBase58String(assetIdStr))) | |
427 | + | unstakeDuck(assetIdStr, ownerKey, ownerKey) | |
428 | + | } | |
429 | + | ||
430 | + | ||
431 | + | ||
432 | + | @Callable(i) | |
433 | + | func unlockDuck (assetIdStr,ts,allowed,signature) = if ((allowed != true)) | |
434 | + | then throw("3UD: Not allowed to unlock the duck!") | |
435 | + | else { | |
436 | + | let MSINHOUR = 3600000 | |
437 | + | let currentTs = lastBlock.timestamp | |
438 | + | if ((currentTs > (ts + MSINHOUR))) | |
439 | + | then throw("3UD: Outdated signature!") | |
440 | + | else { | |
441 | + | let addressStr = toString(i.caller) | |
442 | + | let text = makeString([assetIdStr, toString(ts), toString(allowed)], ";") | |
443 | + | if (!(sigVerify_8Kb(toBytes(text), fromBase58String(signature), getBackendPubKey()))) | |
444 | + | then throw(((("3UD: Invalid proof from backend key" + toBase58String(getBackendPubKey())) + " ") + text)) | |
445 | + | else { | |
446 | + | let validPayment = checkAdditionalPayment(i.payments[0]) | |
447 | + | if ((validPayment == validPayment)) | |
448 | + | then (unstakeDuck(assetIdStr, addressStr, addressStr) ++ validPayment) | |
449 | + | else throw("Strict value is not equal to itself.") | |
450 | + | } | |
451 | + | } | |
452 | + | } | |
453 | + | ||
454 | + |
github/deemru/w8io/026f985 22.22 ms ◑