tx · GBPvQk9YhHR9Kn8nSVikF64fW2k5ERxNNjUzRH6bdAYz 3Myz9GtrZ8K6kbSPSDzd5G4wBjuEDVHLFQc: -0.11300000 Waves 2022.07.27 18:55 [2158425] smart account 3Myz9GtrZ8K6kbSPSDzd5G4wBjuEDVHLFQc > SELF 0.00000000 Waves
{ "type": 13, "id": "GBPvQk9YhHR9Kn8nSVikF64fW2k5ERxNNjUzRH6bdAYz", "fee": 11300000, "feeAssetId": null, "timestamp": 1658937294055, "version": 2, "chainId": 84, "sender": "3Myz9GtrZ8K6kbSPSDzd5G4wBjuEDVHLFQc", "senderPublicKey": "CA71qLoghoRv3dLmoVCAcrCy6etvA68ioPm5f61MKkh", "proofs": [ "jH4XpVzUrRzwCfWxkv7T5MsAuMQh2N91bbhLaPR4Ue9BUap9iw9KtSsMMZv3brFmACx89kh85uj3RQsMz6j8uow" ], "script": "base64:AAIFAAAAAAAAACMIAhIDCgEBEgMKAQgSAwoBCBIDCgEIEgASAwoBCBIECgIICAAAABUAAAAAC2VnZ3NBc3NldElkAQAAACCjn39PI3JR0SziIZJiiE0MC/PqIm6B1a/8C5MXzm2xyQAAAAAQZGVsYXlGb3JIYXRjaGluZwAAAAAAAAAAAgAAAAALdHlwZXNBbW91bnQAAAAAAAAAAAkAAAAAEnJlZkNvbnRyYWN0QWRkcmVzcwEAAAAaAVdJun1CvJ+wEYXBypiq1jTt8AvN7+jD7qUAAAAADVJlZmVyZXJSZXdhcmQAAAAAAAAAAAUAAAAAD0hhdGNoaW5nU3RhcnRlZAIAAAAQSEFUQ0hJTkdfU1RBUlRFRAAAAAAQSGF0Y2hpbmdGaW5pc2hlZAIAAAARSEFUQ0hJTkdfRklOSVNIRUQAAAAADnJlYmlydGhBZGRyZXNzAQAAABoBV3CRddSe63o+H/lkADDI3EZdXJpE33XC9wAAAAAQYmFieUR1Y2tzQWRkcmVzcwEAAAAaAVfDo8tHAeegleDgE8m9dZsB82cmhk/rApEAAAAAEHN3b3BQcm9tb0FkZH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2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5KlfuwQ==", "height": 2158425, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2XukPStAjTju5r8Lc9ht7DHc9Z2krkLjP2eQWu8tqkfh Next: none Diff:
Old | New | Differences | |
---|---|---|---|
59 | 59 | ||
60 | 60 | func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = { | |
61 | 61 | let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1))) | |
62 | - | let randomHash = sha256( | |
62 | + | let randomHash = sha256(txId) | |
63 | 63 | (toInt(randomHash, (offset * 8)) % variants) | |
64 | 64 | } | |
65 | 65 | ||
170 | 170 | else if ((hatchingFinishHeight > height)) | |
171 | 171 | then throw((((("Hatching is not finished yet " + toString((hatchingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((hatchingFinishHeight - height))) + " minutes")) | |
172 | 172 | else { | |
173 | - | let $ | |
174 | - | let duckGen = $ | |
175 | - | let farmGen = $ | |
173 | + | let $t064846550 = getRandomName(txId, hatchingFinishHeight) | |
174 | + | let duckGen = $t064846550._1 | |
175 | + | let farmGen = $t064846550._2 | |
176 | 176 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
177 | 177 | let asset = Issue(duckGen, description, 1, 0, false, unit, hatchingFinishHeight) | |
178 | 178 | let assetId = calculateAssetId(asset) | |
192 | 192 | let finishHeightKey = getHatchingFinishHeightKey(address, txId) | |
193 | 193 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
194 | 194 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
195 | - | let $ | |
196 | - | let duckGen = $ | |
197 | - | let farmGen = $ | |
195 | + | let $t077697820 = getRandomName(txId, (5 + 1)) | |
196 | + | let duckGen = $t077697820._1 | |
197 | + | let farmGen = $t077697820._2 | |
198 | 198 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
199 | 199 | let asset = Issue(duckGen, description, 1, 0, false, unit, height) | |
200 | 200 | let assetId = calculateAssetId(asset) | |
213 | 213 | let finishHeightKey = getHatchingFinishHeightKey(address, txId) | |
214 | 214 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
215 | 215 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
216 | - | let $ | |
217 | - | let duckGen = $ | |
218 | - | let farmGen = $ | |
216 | + | let $t093039355 = $Tuple2((("DUCK-" + gen) + "-JU"), "8W-J") | |
217 | + | let duckGen = $t093039355._1 | |
218 | + | let farmGen = $t093039355._2 | |
219 | 219 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
220 | 220 | let asset = Issue(duckGen, description, 1, 0, false, unit, height) | |
221 | 221 | let assetId = calculateAssetId(asset) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let eggsAssetId = base58'C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS' | |
5 | 5 | ||
6 | 6 | let delayForHatching = 2 | |
7 | 7 | ||
8 | 8 | let typesAmount = 9 | |
9 | 9 | ||
10 | 10 | let refContractAddress = base58'3P8ejTkfRpz9WqCwCuihesNXU5k3zmFFfVe' | |
11 | 11 | ||
12 | 12 | let RefererReward = 5 | |
13 | 13 | ||
14 | 14 | let HatchingStarted = "HATCHING_STARTED" | |
15 | 15 | ||
16 | 16 | let HatchingFinished = "HATCHING_FINISHED" | |
17 | 17 | ||
18 | 18 | let rebirthAddress = base58'3PCC6fVHNa6289DTDmcUo3RuLaFmteZZsmQ' | |
19 | 19 | ||
20 | 20 | let babyDucksAddress = base58'3PKmLiGEfqLWMC1H9xhzqvAZKUXfFm8uoeg' | |
21 | 21 | ||
22 | 22 | let swopPromoAddress = base58'3P6s9C39Ak5FAQ3F5VapYJ3ULxgbsAReXWD' | |
23 | 23 | ||
24 | 24 | func isLocked () = { | |
25 | 25 | let masterAddress = Address(base58'3PEPftf2kWZDmAaWBjs6BUJa9957kiA2PkU') | |
26 | 26 | match getInteger(masterAddress, "egglock") { | |
27 | 27 | case b: Int => | |
28 | 28 | b | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func getHatchingStatusKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_status") | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func getHatchingFinishHeightKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_fh") | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getDuckIdKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_di") | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getDuckStatsKey (genString) = (("stats_" + genString) + "_amount") | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func tryGetInteger (key) = { | |
48 | 48 | let val = match getInteger(this, key) { | |
49 | 49 | case b: Int => | |
50 | 50 | b | |
51 | 51 | case _ => | |
52 | 52 | 0 | |
53 | 53 | } | |
54 | 54 | val | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | let discountCoefficient = tryGetInteger("discountCoefficient") | |
59 | 59 | ||
60 | 60 | func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = { | |
61 | 61 | let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1))) | |
62 | - | let randomHash = sha256( | |
62 | + | let randomHash = sha256(txId) | |
63 | 63 | (toInt(randomHash, (offset * 8)) % variants) | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func wasUniqueBorn (gen) = tryGetInteger(getDuckStatsKey(gen)) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getRandomName (txId,hatchingFinishHeight) = { | |
71 | 71 | let jackpotRandom = getRandomNumber(500, txId, hatchingFinishHeight, 0) | |
72 | 72 | if (if ((5 > jackpotRandom)) | |
73 | 73 | then (wasUniqueBorn("DUCK-WWWCUPID-JU") == 0) | |
74 | 74 | else false) | |
75 | 75 | then $Tuple2("DUCK-WWWCUPID-JU", "1C1D1I1P1U3W-J") | |
76 | 76 | else { | |
77 | 77 | let typeRandom = getRandomNumber(4, txId, hatchingFinishHeight, 0) | |
78 | 78 | let colorRandom = getRandomNumber(4, txId, hatchingFinishHeight, 1) | |
79 | 79 | let color = if ((colorRandom == 0)) | |
80 | 80 | then "Y" | |
81 | 81 | else if ((colorRandom == 1)) | |
82 | 82 | then "G" | |
83 | 83 | else if ((colorRandom == 2)) | |
84 | 84 | then "B" | |
85 | 85 | else "R" | |
86 | 86 | if ((typeRandom == 0)) | |
87 | 87 | then $Tuple2(("DUCK-FFFFFFFF-G" + color), "8F-G") | |
88 | 88 | else if ((typeRandom == 1)) | |
89 | 89 | then $Tuple2(("DUCK-HHHHHHHH-G" + color), "8H-G") | |
90 | 90 | else if ((typeRandom == 2)) | |
91 | 91 | then $Tuple2(("DUCK-GGGGGGGG-G" + color), "8G-G") | |
92 | 92 | else $Tuple2(("DUCK-IIIIIIII-G" + color), "8I-G") | |
93 | 93 | } | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func countEggsNeededAmount (totalDucksAmount) = { | |
98 | 98 | let n = totalDucksAmount | |
99 | 99 | let g = discountCoefficient | |
100 | 100 | let t = typesAmount | |
101 | 101 | let price = pow((100 + ((n * g) / (10 * t))), 2, 5, 1, 2, DOWN) | |
102 | 102 | (price * 1000000) | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(i) | |
107 | 107 | func setDiscount (val) = if ((i.caller != this)) | |
108 | 108 | then throw("admin_only") | |
109 | 109 | else [IntegerEntry("discountCoefficient", val)] | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | ||
113 | 113 | @Callable(i) | |
114 | 114 | func startDuckHatching (refererAddress) = if ((isLocked() > 0)) | |
115 | 115 | then throw("EGG operations are temporarily locked") | |
116 | 116 | else { | |
117 | 117 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
118 | 118 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
119 | 119 | let firstPayment = value(i.payments[0]) | |
120 | 120 | let results = [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))] | |
121 | 121 | if ((i.caller == Address(babyDucksAddress))) | |
122 | 122 | then (results ++ [BooleanEntry((("hatching_" + toBase58String(i.transactionId)) + "_babyDuck"), true)]) | |
123 | 123 | else if ((firstPayment.assetId != eggsAssetId)) | |
124 | 124 | then throw(("You can attach only EGG tokens with the following asset id: " + toBase58String(eggsAssetId))) | |
125 | 125 | else if ((eggsNeeded > firstPayment.amount)) | |
126 | 126 | then throw(("To hatch a duck you currently need the following amount of EGGlets: " + toString(eggsNeeded))) | |
127 | 127 | else { | |
128 | 128 | let refererReward = fraction(eggsNeeded, RefererReward, 100) | |
129 | 129 | let refCall = invoke(Address(refContractAddress), "refPayment", [refererAddress], [AttachedPayment(eggsAssetId, refererReward)]) | |
130 | 130 | if ((refCall == refCall)) | |
131 | 131 | then (results ++ [ScriptTransfer(i.caller, (firstPayment.amount - eggsNeeded), eggsAssetId)]) | |
132 | 132 | else throw("Strict value is not equal to itself.") | |
133 | 133 | } | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(i) | |
139 | 139 | func startDuckHatchingForAddress (address) = if ((isLocked() > 0)) | |
140 | 140 | then throw("EGG operations are temporarily locked") | |
141 | 141 | else if ((i.caller != Address(swopPromoAddress))) | |
142 | 142 | then throw("Pernission denied") | |
143 | 143 | else { | |
144 | 144 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
145 | 145 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
146 | 146 | [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)] | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | ||
151 | 151 | @Callable(i) | |
152 | 152 | func finishDuckHatching (txIdStr) = { | |
153 | 153 | let txId = fromBase58String(txIdStr) | |
154 | 154 | let hatchingStatusKey = getHatchingStatusKey(toString(i.caller), txId) | |
155 | 155 | let finishHeightKey = getHatchingFinishHeightKey(toString(i.caller), txId) | |
156 | 156 | let duckIdKey = getDuckIdKey(toString(i.caller), txId) | |
157 | 157 | let duckFromBaby = match getBoolean((("hatching_" + txIdStr) + "_babyDuck")) { | |
158 | 158 | case t: Boolean => | |
159 | 159 | t | |
160 | 160 | case _ => | |
161 | 161 | false | |
162 | 162 | } | |
163 | 163 | let hatchingTxStatus = getStringValue(this, hatchingStatusKey) | |
164 | 164 | let hatchingFinishHeight = getIntegerValue(this, finishHeightKey) | |
165 | 165 | if ((hatchingTxStatus == HatchingFinished)) | |
166 | 166 | then { | |
167 | 167 | let duckId = getStringValue(this, getDuckIdKey(toString(i.caller), txId)) | |
168 | 168 | throw(("The duck was hatched and claimed already, here is the folowing: " + duckId)) | |
169 | 169 | } | |
170 | 170 | else if ((hatchingFinishHeight > height)) | |
171 | 171 | then throw((((("Hatching is not finished yet " + toString((hatchingFinishHeight - height))) + " blocks remaining, it will take around ") + toString((hatchingFinishHeight - height))) + " minutes")) | |
172 | 172 | else { | |
173 | - | let $ | |
174 | - | let duckGen = $ | |
175 | - | let farmGen = $ | |
173 | + | let $t064846550 = getRandomName(txId, hatchingFinishHeight) | |
174 | + | let duckGen = $t064846550._1 | |
175 | + | let farmGen = $t064846550._2 | |
176 | 176 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
177 | 177 | let asset = Issue(duckGen, description, 1, 0, false, unit, hatchingFinishHeight) | |
178 | 178 | let assetId = calculateAssetId(asset) | |
179 | 179 | let amount = (tryGetInteger(getDuckStatsKey(duckGen)) + 1) | |
180 | 180 | [StringEntry(hatchingStatusKey, HatchingFinished), StringEntry(duckIdKey, toBase58String(assetId)), StringEntry(toBase58String(assetId), duckIdKey), BooleanEntry((("duck_" + toBase58String(assetId)) + "_grown"), duckFromBaby), IntegerEntry(getDuckStatsKey(duckGen), amount), IntegerEntry((("stats_" + farmGen) + "_quantity"), (tryGetInteger((("stats_" + farmGen) + "_quantity")) + 1)), asset, ScriptTransfer(i.caller, 1, assetId)] | |
181 | 181 | } | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | ||
186 | 186 | @Callable(i) | |
187 | 187 | func issueFreeDuck () = { | |
188 | 188 | let address = toBase58String(i.caller.bytes) | |
189 | 189 | let txIdStr = toBase58String(i.transactionId) | |
190 | 190 | let txId = fromBase58String(txIdStr) | |
191 | 191 | let hatchingStatusKey = getHatchingStatusKey(address, txId) | |
192 | 192 | let finishHeightKey = getHatchingFinishHeightKey(address, txId) | |
193 | 193 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
194 | 194 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
195 | - | let $ | |
196 | - | let duckGen = $ | |
197 | - | let farmGen = $ | |
195 | + | let $t077697820 = getRandomName(txId, (5 + 1)) | |
196 | + | let duckGen = $t077697820._1 | |
197 | + | let farmGen = $t077697820._2 | |
198 | 198 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
199 | 199 | let asset = Issue(duckGen, description, 1, 0, false, unit, height) | |
200 | 200 | let assetId = calculateAssetId(asset) | |
201 | 201 | let amount = (tryGetInteger(getDuckStatsKey(duckGen)) + 1) | |
202 | 202 | let duckIdKey = getDuckIdKey(address, txId) | |
203 | 203 | $Tuple2([IntegerEntry(getHatchingFinishHeightKey(address, txId), height), IntegerEntry("ducks_amount", (totalDucksAmount + 1)), IntegerEntry("ducks_last_price", (eggsNeeded / 1000000)), StringEntry(toBase58String(assetId), toBase58String(assetId)), StringEntry(toBase58String(i.transactionId), toBase58String(assetId)), 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)) | |
204 | 204 | } | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(i) | |
209 | 209 | func issueJackpot (gen) = { | |
210 | 210 | let txId = i.transactionId | |
211 | 211 | let address = toBase58String(i.caller.bytes) | |
212 | 212 | let hatchingStatusKey = getHatchingStatusKey(address, txId) | |
213 | 213 | let finishHeightKey = getHatchingFinishHeightKey(address, txId) | |
214 | 214 | let totalDucksAmount = tryGetInteger("ducks_amount") | |
215 | 215 | let eggsNeeded = countEggsNeededAmount(totalDucksAmount) | |
216 | - | let $ | |
217 | - | let duckGen = $ | |
218 | - | let farmGen = $ | |
216 | + | let $t093039355 = $Tuple2((("DUCK-" + gen) + "-JU"), "8W-J") | |
217 | + | let duckGen = $t093039355._1 | |
218 | + | let farmGen = $t093039355._2 | |
219 | 219 | let description = (("{\"genotype\": \"" + duckGen) + "\", \"crossbreeding\": true}") | |
220 | 220 | let asset = Issue(duckGen, description, 1, 0, false, unit, height) | |
221 | 221 | let assetId = calculateAssetId(asset) | |
222 | 222 | let duckIdKey = getDuckIdKey(address, txId) | |
223 | 223 | $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)) | |
224 | 224 | } | |
225 | 225 | ||
226 | 226 | ||
227 | 227 | ||
228 | 228 | @Callable(i) | |
229 | 229 | func reduceRarity (assetId,fGen) = { | |
230 | 230 | let asset = fromBase58String(assetId) | |
231 | 231 | if (if ((i.caller != Address(rebirthAddress))) | |
232 | 232 | then (i.caller != this) | |
233 | 233 | else false) | |
234 | 234 | then throw("admin or rebirth only") | |
235 | 235 | else { | |
236 | 236 | let duckGen = value(assetInfo(asset)).name | |
237 | 237 | let letter = takeRight(take(duckGen, 6), 1) | |
238 | 238 | let farmGen = (("8" + letter) + "-G") | |
239 | 239 | [IntegerEntry(getDuckStatsKey(duckGen), (tryGetInteger(getDuckStatsKey(duckGen)) - 1)), IntegerEntry((("stats_" + farmGen) + "_quantity"), (tryGetInteger((("stats_" + farmGen) + "_quantity")) - 1))] | |
240 | 240 | } | |
241 | 241 | } | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | @Verifier(tx) | |
245 | 245 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
246 | 246 |
github/deemru/w8io/169f3d6 50.52 ms ◑