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