tx · CaWCvkNGCQ3royZtbKRRmeSUvHSvMRtkNQDihVznLSt1 3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu: -0.00800000 Waves 2022.08.24 12:40 [2198392] smart account 3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu > SELF 0.00000000 Waves
{ "type": 13, "id": "CaWCvkNGCQ3royZtbKRRmeSUvHSvMRtkNQDihVznLSt1", "fee": 800000, "feeAssetId": null, "timestamp": 1661334040982, "version": 2, "chainId": 84, "sender": "3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu", "senderPublicKey": "FbyxDzJQJeCSLtjFFYUf8YN6yLMPB1sXnpiQ13oFNHWd", "proofs": [ "4fgfQxAs2Rrr5QTHnLwRHtcGkqpbei5EbXQPfdmCPTBuAFM7MyJfHXMmk8gc1cYo4s3bs6B4GCwMsYsas71GdcCD" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAACwAAAAAJbWF4U3VwcGx5AAAAAAAAAAPoAAAAAAV3YXZlcwAAAAAABfXhAAEAAAAMZ2V0UHVua0lES2V5AAAAAQAAAAJpZAkAASwAAAACAgAAAAVwdW5rXwUAAAACaWQBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADXRyeUdldEJvb2xlYW4AAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgcFAAAAA3ZhbAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoM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AAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmX8EYA", "height": 2198392, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AJVRdwRMi6GJH9X2y6uJqmEo3qAr9nLsRDyxiq7s4hfy Next: none Diff:
Old | New | Differences | |
---|---|---|---|
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getURL (id) = if (containsElement(split(tryGetString("gif_punk"), ","), id)) | |
45 | - | then (("https://images.wavespunks.com/mad/ | |
46 | - | else (("https://images.wavespunks.com/mad/ | |
45 | + | then (("https://images.wavespunks.com/mad/empire/" + id) + ".gif") | |
46 | + | else (("https://images.wavespunks.com/mad/empire/" + id) + ".png") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getTypePunk (id) = { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let maxSupply = 1000 | |
5 | 5 | ||
6 | 6 | let waves = 100000000 | |
7 | 7 | ||
8 | 8 | func getPunkIDKey (id) = ("punk_" + id) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func tryGetInteger (key) = { | |
12 | 12 | let val = match getInteger(this, key) { | |
13 | 13 | case b: Int => | |
14 | 14 | b | |
15 | 15 | case _ => | |
16 | 16 | 0 | |
17 | 17 | } | |
18 | 18 | val | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func tryGetBoolean (key) = { | |
23 | 23 | let val = match getBoolean(this, key) { | |
24 | 24 | case b: Boolean => | |
25 | 25 | b | |
26 | 26 | case _ => | |
27 | 27 | false | |
28 | 28 | } | |
29 | 29 | val | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func tryGetString (key) = { | |
34 | 34 | let val = match getString(this, key) { | |
35 | 35 | case b: String => | |
36 | 36 | b | |
37 | 37 | case _ => | |
38 | 38 | "" | |
39 | 39 | } | |
40 | 40 | val | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getURL (id) = if (containsElement(split(tryGetString("gif_punk"), ","), id)) | |
45 | - | then (("https://images.wavespunks.com/mad/ | |
46 | - | else (("https://images.wavespunks.com/mad/ | |
45 | + | then (("https://images.wavespunks.com/mad/empire/" + id) + ".gif") | |
46 | + | else (("https://images.wavespunks.com/mad/empire/" + id) + ".png") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getTypePunk (id) = { | |
50 | 50 | let idINT = match parseInt(id) { | |
51 | 51 | case i: Int => | |
52 | 52 | i | |
53 | 53 | case i: Unit => | |
54 | 54 | 0 | |
55 | 55 | case _ => | |
56 | 56 | throw("Match error") | |
57 | 57 | } | |
58 | 58 | if (containsElement(split(tryGetString("gif_punk"), ","), toString(idINT))) | |
59 | 59 | then "ultra-rare" | |
60 | 60 | else if ((29 >= idINT)) | |
61 | 61 | then "rare" | |
62 | 62 | else "unique" | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getRandomNumber (variants,txId,heightBlock,offset) = { | |
67 | 67 | let randomSeedBlock = value(blockInfoByHeight((heightBlock - 1))) | |
68 | 68 | let randomHash = sha256_16Kb((txId + value(randomSeedBlock.vrf))) | |
69 | 69 | (toInt(randomHash, offset) % variants) | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func calcWavesNeeded () = (waves * 6) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func _mint (i,totalPunksSupply,availablePunks) = { | |
77 | 77 | let listAvailablePunks = split(availablePunks, ",") | |
78 | 78 | let rand = getRandomNumber((maxSupply - totalPunksSupply), i.transactionId, height, 0) | |
79 | 79 | let punkId = listAvailablePunks[rand] | |
80 | 80 | let name = ("MadPunk #" + punkId) | |
81 | 81 | let meta = tryGetString("collection_description") | |
82 | 82 | let asset = Issue(name, meta, 1, 0, false, unit, height) | |
83 | 83 | let assetId = calculateAssetId(asset) | |
84 | 84 | let tx = [IntegerEntry("punks_supply", (totalPunksSupply + 1)), StringEntry("available_punks", makeString(removeByIndex(listAvailablePunks, rand), ",")), asset, StringEntry(getPunkIDKey(punkId), toBase58String(assetId)), StringEntry((toBase58String(assetId) + "_id"), getPunkIDKey(punkId)), StringEntry((toBase58String(assetId) + "_type"), getTypePunk(punkId)), StringEntry((toBase58String(assetId) + "_url"), getURL(punkId)), StringEntry((toBase58String(assetId) + "_fraction"), tryGetString("fraction")), ScriptTransfer(i.caller, 1, assetId)] | |
85 | 85 | tx | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(i) | |
90 | 90 | func mint () = { | |
91 | 91 | let punkId = toString(5) | |
92 | 92 | let name = ("MadPunk #" + punkId) | |
93 | 93 | let meta = tryGetString("collection_description") | |
94 | 94 | let asset = Issue(name, meta, 1, 0, false, unit, height) | |
95 | 95 | let assetId = calculateAssetId(asset) | |
96 | 96 | let tx = [asset, StringEntry(getPunkIDKey(punkId), toBase58String(assetId)), StringEntry((toBase58String(assetId) + "_id"), getPunkIDKey(punkId)), StringEntry((toBase58String(assetId) + "_type"), getTypePunk(punkId)), StringEntry((toBase58String(assetId) + "_url"), getURL(punkId)), StringEntry((toBase58String(assetId) + "_fraction"), tryGetString("fraction")), ScriptTransfer(i.caller, 1, assetId)] | |
97 | 97 | tx | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | @Verifier(tx) | |
102 | 102 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
103 | 103 |
github/deemru/w8io/026f985 28.04 ms ◑