tx · BMzqnMjVMQrK9WcQC1eQELsNQe24yYtqXqhf9zLv73wX 3N6oB7VbceD3NoguGkfGnBMF4hcHZVbK8io: -0.01700000 Waves 2024.11.25 23:35 [3387426] smart account 3N6oB7VbceD3NoguGkfGnBMF4hcHZVbK8io > SELF 0.00000000 Waves
{ "type": 13, "id": "BMzqnMjVMQrK9WcQC1eQELsNQe24yYtqXqhf9zLv73wX", "fee": 1700000, "feeAssetId": null, "timestamp": 1732567004147, "version": 2, "chainId": 84, "sender": "3N6oB7VbceD3NoguGkfGnBMF4hcHZVbK8io", "senderPublicKey": "2cUCdub81Us7Le3h97BRsS5HupDXo5sErj1dwyNHKNU2", "proofs": [ "4Snahu4RnEBRqz8EKQvJR5n1jfxfq8tCRJLupgo8hiQA9o99vPxzzFowNUpMJjhzt83hZGYFgwK7VkmgsKy735ND" ], "script": "base64:BgJACAISAwoBCBIDCgEBEgMKAQESAwoBCBIDCgEIEgMKAQgSBAoCCAgSBQoDCAgIEgUKAwgICBIECgIICBIECgIICCABFHRyeUdldFN0cmluZ0V4dGVybmFsAgdhZGRyZXNzA2tleQQHJG1hdGNoMAkAnQgCBQdhZGRyZXNzBQNrZXkDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBQFhAgABDHRyeUdldFN0cmluZwEDa2V5CQEUdHJ5R2V0U3RyaW5nRXh0ZXJuYWwCBQR0aGlzBQNrZXkBHnN0YXRpY0tleV90dXJ0bGVSZWJpcnRoQWRkcmVzcwACG3N0YXRpY190dXJ0bGVSZWJpcnRoQWRkcmVzcwEJZ2V0T3JhY2xlAAkBB0FkZHJlc3MBCQDZBAEJAQx0cnlHZXRTdHJpbmcBAhRzdGF0aWNfb3JhY2xlQWRkcmVzcwENZ2V0RWdnQXNzZXRJZAAJANkEAQkBFHRyeUdldFN0cmluZ0V4dGVybmFsAgkBCWdldE9yYWNsZQACEXN0YXRpY19lZ2dBc3NldElkARFnZXRSZWJpcnRoQWRkcmVzcwAJAQdBZ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ZzAAEFCnNlY29uZFVzZXIAAQMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFCnNlY29uZFVzZXIAAQAABA90aGlyZFVzZXJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQl0aGlyZFVzZXIAAQMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFCXRoaXJkVXNlcgABAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUJdGhpcmRVc2VyAAEAAAQPc2lnbmF0dXJlc0NvdW50CQBkAgkAZAIFD2ZpcnN0VXNlclNpZ25lZAUQc2Vjb25kVXNlclNpZ25lZAUPdGhpcmRVc2VyU2lnbmVkBAckbWF0Y2gwBQJ0eAkAZwIFD3NpZ25hdHVyZXNDb3VudAACp1NTQQ==", "height": 3387426, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GKU2UhMYuSVNJUSFZV9jmYQBspiC5UjYpYxHwtxZGxbb Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func tryGetStringExternal (address,key) = match getString(address, key) { | |
5 | 5 | case a: String => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | "" | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func tryGetString (key) = tryGetStringExternal(this, key) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func staticKey_turtleRebirthAddress () = "static_turtleRebirthAddress" | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func getOracle () = Address(fromBase58String(tryGetString("static_oracleAddress"))) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func getEggAssetId () = fromBase58String(tryGetStringExternal(getOracle(), "static_eggAssetId")) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func getRebirthAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_rebirthAddress"))) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getBabyDuckAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_babyDuckAddress"))) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getRefContractAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_refContractAddress"))) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getCouponsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_couponsAddress"))) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getBurnAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_burnAddress"))) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func getTurtleRebirthAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_turtleRebirthAddress()))) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | let delayForHatching = 2 | |
43 | 43 | ||
44 | 44 | let typesAmount = 10 | |
45 | 45 | ||
46 | 46 | let RefererReward = 5 | |
47 | 47 | ||
48 | 48 | let HatchingStarted = "HATCHING_STARTED" | |
49 | 49 | ||
50 | 50 | let HatchingFinished = "HATCHING_FINISHED" | |
51 | 51 | ||
52 | 52 | func isLocked () = { | |
53 | 53 | let masterAddress = Address(base58'3PEPftf2kWZDmAaWBjs6BUJa9957kiA2PkU') | |
54 | 54 | match getInteger(masterAddress, "egglock") { | |
55 | 55 | case b: Int => | |
56 | 56 | b | |
57 | 57 | case _ => | |
58 | 58 | 0 | |
59 | 59 | } | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getHatchingStatusKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_status") | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getHatchingFinishHeightKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_fh") | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getDuckIdKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_di") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getDuckStatsKey (genString) = (("stats_" + genString) + "_amount") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func tryGetInteger (key) = { | |
76 | 76 | let val = match getInteger(this, key) { | |
77 | 77 | case b: Int => | |
78 | 78 | b | |
79 | 79 | case _ => | |
80 | 80 | 0 | |
81 | 81 | } | |
82 | 82 | val | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | let discountCoefficient = tryGetInteger("discountCoefficient") | |
87 | 87 | ||
88 | 88 | let saleCoefficient = tryGetInteger("saleCoefficient") | |
89 | 89 | ||
90 | 90 | func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = { | |
91 | 91 | let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1))) | |
92 | 92 | let randomHash = sha256(((base58'incubator' + txId) + value(randomSeedBlock.vrf))) | |
93 | 93 | (toInt(randomHash, offset) % variants) | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func wasUniqueBorn (gen) = tryGetInteger(getDuckStatsKey(gen)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getRandomName (txId,hatchingFinishHeight) = { | |
101 | 101 | let jackpotRandom = getRandomNumber(200, txId, hatchingFinishHeight, 4) | |
102 | 102 | let entry = IntegerEntry("last_jackpot_random", jackpotRandom) | |
103 | 103 | let typeRandom = getRandomNumber(4, txId, hatchingFinishHeight, 5) | |
104 | 104 | let colorRandom = getRandomNumber(4, txId, hatchingFinishHeight, 6) | |
105 | 105 | let color = if ((colorRandom == 0)) | |
106 | 106 | then "Y" | |
107 | 107 | else if ((colorRandom == 1)) | |
108 | 108 | then "G" | |
109 | 109 | else if ((colorRandom == 2)) | |
110 | 110 | then "B" | |
111 | 111 | else "R" | |
112 | 112 | if ((typeRandom == 0)) | |
113 | 113 | then $Tuple3(("DUCK-MMMMMMMM-G" + color), "8M-G", entry) | |
114 | 114 | else if ((typeRandom == 1)) | |
115 | 115 | then $Tuple3(("DUCK-NNNNNNNN-G" + color), "8N-G", entry) | |
116 | 116 | else if ((typeRandom == 2)) | |
117 | 117 | then $Tuple3(("DUCK-OOOOOOOO-G" + color), "8O-G", entry) | |
118 | 118 | else $Tuple3(("DUCK-PPPPPPPP-G" + color), "8P-G", entry) | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func countEggsNeededAmount (totalDucksAmount) = { | |
123 | 123 | let n = totalDucksAmount | |
124 | 124 | let g = discountCoefficient | |
125 | 125 | let s = saleCoefficient | |
126 | 126 | let t = typesAmount | |
127 | 127 | let price = pow((100 + ((n * g) / (10 * t))), 2, 5, 1, 2, DOWN) | |
128 | 128 | if ((saleCoefficient == 0)) | |
129 | 129 | then (price * 1000000) | |
130 | 130 | else (((price * 1000000) / 100) * (100 - saleCoefficient)) | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func asInt (value) = match value { | |
135 | 135 | case int: Int => | |
136 | 136 | int | |
137 | 137 | case _ => | |
138 | 138 | throw("IAI: wrong type, expected: Int") | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func finishHatchingInternal (txIdStr,owner) = { | |
143 | 143 | let txId = fromBase58String(txIdStr) | |
144 | 144 | let hatchingStatusKey = getHatchingStatusKey(owner, txId) | |
145 | 145 | let finishHeightKey = getHatchingFinishHeightKey(owner, txId) | |
146 | 146 | let duckIdKey = getDuckIdKey(owner, txId) | |
147 | 147 | let duckFromBaby = match getBoolean((("hatching_" + txIdStr) + "_babyDuck")) { | |
148 | 148 | case t: Boolean => | |
149 | 149 | t | |
150 | 150 | case _ => | |
151 | 151 | false | |
152 | 152 | } | |
153 | 153 | let hatchingTxStatus = getStringValue(this, hatchingStatusKey) | |
154 | 154 | let hatchingFinishHeight = getIntegerValue(this, finishHeightKey) | |
155 | 155 | if ((hatchingTxStatus == HatchingFinished)) | |
156 | 156 | then { | |
157 | 157 | let duckId = getStringValue(this, getDuckIdKey(owner, txId)) | |
158 | 158 | throw(("IFDH: The duck was hatched and claimed already, here is the folowing: " + duckId)) | |
159 | 159 | } | |
160 | 160 | else if ((hatchingFinishHeight > height)) | |
161 | 161 | then throw((((("Hatching is not finished yet " + toString((hatchingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((hatchingFinishHeight - height))) + " minutes")) | |
162 | 162 | else { | |
163 | 163 | let $t055055591 = getRandomName(txId, hatchingFinishHeight) | |
164 | 164 | let duckGen = $t055055591._1 | |
165 | 165 | let farmGen = $t055055591._2 | |
166 | 166 | let jackpotRandomEntry = $t055055591._3 | |
167 | 167 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
168 | 168 | let asset = Issue(duckGen, description, 1, 0, false, unit, hatchingFinishHeight) | |
169 | 169 | let assetId = calculateAssetId(asset) | |
170 | 170 | let amount = (tryGetInteger(getDuckStatsKey(duckGen)) + 1) | |
171 | 171 | [StringEntry(hatchingStatusKey, HatchingFinished), StringEntry(duckIdKey, toBase58String(assetId)), StringEntry(toBase58String(assetId), duckIdKey), BooleanEntry((("duck_" + toBase58String(assetId)) + "_grown"), duckFromBaby), IntegerEntry(getDuckStatsKey(duckGen), amount), jackpotRandomEntry, IntegerEntry((("stats_" + farmGen) + "_quantity"), (tryGetInteger((("stats_" + farmGen) + "_quantity")) + 1)), asset, ScriptTransfer(Address(fromBase58String(owner)), 1, assetId)] | |
172 | 172 | } | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func getBool (key) = match getBoolean(this, key) { | |
177 | 177 | case b: Boolean => | |
178 | 178 | b | |
179 | 179 | case _ => | |
180 | 180 | false | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func isTestEnv () = getBool("TESTENV") | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func configureOracle (oracle) = if ((i.caller != this)) | |
189 | 189 | then throw("ICU: admin only") | |
190 | 190 | else [StringEntry("static_oracleAddress", oracle)] | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | 195 | func setDiscount (val) = if ((i.caller != this)) | |
196 | 196 | then throw("ISD: admin_only") | |
197 | 197 | else [IntegerEntry("discountCoefficient", val)] | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | ||
201 | 201 | @Callable(i) | |
202 | 202 | func setSale (val) = if ((i.caller != this)) | |
203 | 203 | then throw("ISS: admin_only") | |
204 | 204 | else [IntegerEntry("saleCoefficient", val)] | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(i) | |
209 | 209 | func startDuckHatching (refererAddress) = if ((getBabyDuckAddress() != i.caller)) | |
210 | 210 | then throw("ISDHFA: From now on this is only possible through ducklings!") | |
211 | 211 | else if ((isLocked() > 0)) | |
212 | 212 | then throw("ISDH: EGG operations are temporarily locked") | |
213 | 213 | else { | |
214 | 214 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
215 | 215 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
216 | 216 | [StringEntry(getHatchingStatusKey(toString(i.originCaller), i.transactionId), HatchingStarted), IntegerEntry(getHatchingFinishHeightKey(toString(i.originCaller), i.transactionId), (height + delayForHatching)), IntegerEntry("ducks_amount", (totalDucksAmount + 1)), IntegerEntry("ducks_last_price", (eggsNeeded / 1000000)), BooleanEntry((("hatching_" + toBase58String(i.transactionId)) + "_babyDuck"), true)] | |
217 | 217 | } | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | ||
221 | 221 | @Callable(i) | |
222 | 222 | func startDuckHatchingForAddress (address) = if ((isLocked() > 0)) | |
223 | 223 | then throw("ISDHFA: EGG operations are temporarily locked") | |
224 | 224 | else if ((i.caller != this)) | |
225 | 225 | then throw("ISDHFA: Permission denied") | |
226 | 226 | else { | |
227 | 227 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
228 | 228 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
229 | 229 | [StringEntry(getHatchingStatusKey(address, i.transactionId), HatchingStarted), IntegerEntry(getHatchingFinishHeightKey(address, i.transactionId), (height + delayForHatching)), IntegerEntry("ducks_amount", (totalDucksAmount + 1)), IntegerEntry("ducks_last_price", (eggsNeeded / 1000000)), BooleanEntry((("hatching_" + toBase58String(i.transactionId)) + "_promo"), true)] | |
230 | 230 | } | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | ||
234 | 234 | @Callable(i) | |
235 | 235 | func finishDuckHatching (txIdStr) = { | |
236 | 236 | let owner = toString(i.originCaller) | |
237 | 237 | finishHatchingInternal(txIdStr, owner) | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Callable(i) | |
243 | 243 | func issueFreeDuck (address,txIdStr) = if ((i.caller != getRebirthAddress())) | |
244 | 244 | then throw("ISFD: rebirth only") | |
245 | 245 | else { | |
246 | 246 | let txId = fromBase58String(txIdStr) | |
247 | 247 | let hatchingStatusKey = getHatchingStatusKey(address, txId) | |
248 | 248 | let finishHeightKey = getHatchingFinishHeightKey(address, txId) | |
249 | 249 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
250 | 250 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
251 | 251 | let $t093379499 = getRandomName(txId, (valueOrErrorMessage(transactionHeightById(txId), ((txIdStr + " not found ") + toBase58String(txId))) + 1)) | |
252 | 252 | let duckGen = $t093379499._1 | |
253 | 253 | let farmGen = $t093379499._2 | |
254 | 254 | let jackpotRandomEntry = $t093379499._3 | |
255 | 255 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
256 | 256 | let asset = Issue(duckGen, description, 1, 0, false, unit, height) | |
257 | 257 | let assetId = calculateAssetId(asset) | |
258 | 258 | let amount = (tryGetInteger(getDuckStatsKey(duckGen)) + 1) | |
259 | 259 | let duckIdKey = getDuckIdKey(address, txId) | |
260 | 260 | $Tuple2([IntegerEntry(getHatchingFinishHeightKey(address, txId), height), IntegerEntry("ducks_amount", (totalDucksAmount + 1)), IntegerEntry("ducks_last_price", (eggsNeeded / 1000000)), jackpotRandomEntry, StringEntry(hatchingStatusKey, HatchingFinished), StringEntry(duckIdKey, toBase58String(assetId)), StringEntry(toBase58String(assetId), duckIdKey), IntegerEntry(getDuckStatsKey(duckGen), amount), IntegerEntry((("stats_" + farmGen) + "_quantity"), (tryGetInteger((("stats_" + farmGen) + "_quantity")) + 1)), asset, ScriptTransfer(value(addressFromString(address)), 1, assetId)], toBase58String(assetId)) | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | ||
265 | 265 | @Callable(i) | |
266 | 266 | func issueFreeDuckDefinedGenes (address,txIdStr,genes) = if (if ((i.caller != this)) | |
267 | 267 | then (i.caller != getTurtleRebirthAddress()) | |
268 | 268 | else false) | |
269 | 269 | then throw("IIFDDG: Admin only!") | |
270 | 270 | else { | |
271 | 271 | let txId = fromBase58String(txIdStr) | |
272 | 272 | let hatchingStatusKey = getHatchingStatusKey(address, txId) | |
273 | 273 | let finishHeightKey = getHatchingFinishHeightKey(address, txId) | |
274 | 274 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
275 | 275 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
276 | 276 | let colorRandom = getRandomNumber(4, txId, height, 6) | |
277 | 277 | let color = if ((colorRandom == 0)) | |
278 | 278 | then "Y" | |
279 | 279 | else if ((colorRandom == 1)) | |
280 | 280 | then "G" | |
281 | 281 | else if ((colorRandom == 2)) | |
282 | 282 | then "B" | |
283 | 283 | else "R" | |
284 | 284 | let $t01119611273 = $Tuple2(((("DUCK-" + genes) + "-G") + color), (("8" + take(genes, 1)) + "-G")) | |
285 | 285 | let duckGen = $t01119611273._1 | |
286 | 286 | let farmGen = $t01119611273._2 | |
287 | 287 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
288 | 288 | let asset = Issue(duckGen, description, 1, 0, false, unit, height) | |
289 | 289 | let assetId = calculateAssetId(asset) | |
290 | 290 | let amount = (tryGetInteger(getDuckStatsKey(duckGen)) + 1) | |
291 | 291 | let duckIdKey = getDuckIdKey(address, txId) | |
292 | 292 | $Tuple2([IntegerEntry(getHatchingFinishHeightKey(address, txId), height), IntegerEntry("ducks_amount", (totalDucksAmount + 1)), IntegerEntry("ducks_last_price", (eggsNeeded / 1000000)), StringEntry(hatchingStatusKey, HatchingFinished), StringEntry(duckIdKey, toBase58String(assetId)), StringEntry(toBase58String(assetId), duckIdKey), IntegerEntry(getDuckStatsKey(duckGen), amount), IntegerEntry((("stats_" + farmGen) + "_quantity"), (tryGetInteger((("stats_" + farmGen) + "_quantity")) + 1)), asset, ScriptTransfer(value(addressFromString(address)), 1, assetId)], toBase58String(assetId)) | |
293 | 293 | } | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | ||
297 | 297 | @Callable(i) | |
298 | 298 | func issueJackpot (address,txIdStr,gen) = if (if ((i.caller != getRebirthAddress())) | |
299 | 299 | then (i.caller != this) | |
300 | 300 | else false) | |
301 | 301 | then throw("ISJ: admin or rebirth only") | |
302 | 302 | else { | |
303 | 303 | let txId = fromBase58String(txIdStr) | |
304 | 304 | let hatchingStatusKey = getHatchingStatusKey(address, txId) | |
305 | 305 | let finishHeightKey = getHatchingFinishHeightKey(address, txId) | |
306 | 306 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
307 | 307 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
308 | 308 | let $t01272212774 = $Tuple2((("DUCK-" + gen) + "-JU"), "8W-J") | |
309 | 309 | let duckGen = $t01272212774._1 | |
310 | 310 | let farmGen = $t01272212774._2 | |
311 | 311 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
312 | 312 | let asset = Issue(duckGen, description, 1, 0, false, unit, height) | |
313 | 313 | let assetId = calculateAssetId(asset) | |
314 | 314 | let duckIdKey = getDuckIdKey(address, txId) | |
315 | 315 | let valueDuckIdKeyExits = tryGetString(duckIdKey) | |
316 | 316 | if ((valueDuckIdKeyExits != "")) | |
317 | 317 | then throw((("ISJ: You will override following duckId :" + duckIdKey) + " make sure that your txId is unique!")) | |
318 | 318 | else $Tuple2([IntegerEntry(getHatchingFinishHeightKey(address, txId), height), IntegerEntry("ducks_amount", (totalDucksAmount + 1)), IntegerEntry("ducks_last_price", (eggsNeeded / 1000000)), StringEntry(hatchingStatusKey, HatchingFinished), StringEntry(duckIdKey, toBase58String(assetId)), StringEntry(toBase58String(assetId), duckIdKey), IntegerEntry(getDuckStatsKey(duckGen), (tryGetInteger(getDuckStatsKey(duckGen)) + 1)), IntegerEntry((("stats_" + farmGen) + "_quantity"), (tryGetInteger((("stats_" + farmGen) + "_quantity")) + 1)), asset, ScriptTransfer(value(addressFromString(address)), 1, assetId)], toBase58String(assetId)) | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | 323 | @Callable(i) | |
324 | 324 | func reduceRarity (assetId,fGen) = { | |
325 | 325 | let asset = fromBase58String(assetId) | |
326 | 326 | if (if ((i.caller != getRebirthAddress())) | |
327 | 327 | then (i.caller != this) | |
328 | 328 | else false) | |
329 | 329 | then throw("IRR: admin or rebirth only") | |
330 | 330 | else { | |
331 | 331 | let duckGen = value(assetInfo(asset)).name | |
332 | 332 | let letter = takeRight(take(duckGen, 6), 1) | |
333 | 333 | let farmGen = (("8" + letter) + "-G") | |
334 | 334 | [IntegerEntry(getDuckStatsKey(duckGen), (tryGetInteger(getDuckStatsKey(duckGen)) - 1)), IntegerEntry((("stats_" + farmGen) + "_quantity"), (tryGetInteger((("stats_" + farmGen) + "_quantity")) - 1))] | |
335 | 335 | } | |
336 | 336 | } | |
337 | 337 | ||
338 | 338 | ||
339 | 339 | ||
340 | 340 | @Callable(i) | |
341 | 341 | func finishDuckHatchingAdmin (txIdStr,owner) = if ((i.caller != this)) | |
342 | 342 | then throw("IFDHA: Only admins can run this!") | |
343 | 343 | else finishHatchingInternal(txIdStr, owner) | |
344 | 344 | ||
345 | 345 | ||
346 | 346 | @Verifier(tx) | |
347 | 347 | func verify () = if (isTestEnv()) | |
348 | 348 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
349 | 349 | else { | |
350 | 350 | let firstUser = base58'6TdaXEfhnjYquvPf3yV7MFxt2CbgFmaqsvGwkKfXtKi4' | |
351 | 351 | let secondUser = base58'7DsP2WaMLocbHuUxux7pbXRjTrrZ1TFQPsi5QumS3gr8' | |
352 | 352 | let thirdUser = base58'BpFWP3p3JgYrrP45xfrKzeMcWMEXoinj4FVPPkUiA8D3' | |
353 | 353 | let firstUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], firstUser)) | |
354 | 354 | then 1 | |
355 | 355 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], firstUser)) | |
356 | 356 | then 1 | |
357 | 357 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], firstUser)) | |
358 | 358 | then 1 | |
359 | 359 | else 0 | |
360 | 360 | let secondUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], secondUser)) | |
361 | 361 | then 1 | |
362 | 362 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], secondUser)) | |
363 | 363 | then 1 | |
364 | 364 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], secondUser)) | |
365 | 365 | then 1 | |
366 | 366 | else 0 | |
367 | 367 | let thirdUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], thirdUser)) | |
368 | 368 | then 1 | |
369 | 369 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], thirdUser)) | |
370 | 370 | then 1 | |
371 | 371 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], thirdUser)) | |
372 | 372 | then 1 | |
373 | 373 | else 0 | |
374 | 374 | let signaturesCount = ((firstUserSigned + secondUserSigned) + thirdUserSigned) | |
375 | 375 | match tx { | |
376 | 376 | case _ => | |
377 | 377 | (signaturesCount >= 2) | |
378 | 378 | } | |
379 | 379 | } | |
380 | 380 |
github/deemru/w8io/026f985 37.16 ms ◑