tx · AJVRdwRMi6GJH9X2y6uJqmEo3qAr9nLsRDyxiq7s4hfy

3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu:  -0.00800000 Waves

2022.08.24 12:32 [2198386] smart account 3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu > SELF 0.00000000 Waves

{ "type": 13, "id": "AJVRdwRMi6GJH9X2y6uJqmEo3qAr9nLsRDyxiq7s4hfy", "fee": 800000, "feeAssetId": null, "timestamp": 1661333615783, "version": 2, "chainId": 84, "sender": "3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu", "senderPublicKey": "FbyxDzJQJeCSLtjFFYUf8YN6yLMPB1sXnpiQ13oFNHWd", "proofs": [ "2wC1k2r8aQUSQG1e4uDmK92y8DwKBHSLQ9B22f2qQxfGSck8jfaWyQffwGmT5fFWfdWHyjBaPAzmVbhMaxCNUjgW" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAACwAAAAAJbWF4U3VwcGx5AAAAAAAAAAPoAAAAAAV3YXZlcwAAAAAABfXhAAEAAAAMZ2V0UHVua0lES2V5AAAAAQAAAAJpZAkAASwAAAACAgAAAAVwdW5rXwUAAAACaWQBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADXRyeUdldEJvb2xlYW4AAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgcFAAAAA3ZhbAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1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ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BIPTyA==", "height": 2198386, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DZuzK4vAPbzoyMrGGQTutn76wempBaJe3XRLsH1Dq4UW Next: CaWCvkNGCQ3royZtbKRRmeSUvHSvMRtkNQDihVznLSt1 Diff:
OldNewDifferences
4242
4343
4444 func getURL (id) = if (containsElement(split(tryGetString("gif_punk"), ","), id))
45- then (("https://mypunks.wavespunks.com/mad/m" + id) + ".gif")
46- else (("https://mypunks.wavespunks.com/mad/m" + id) + ".png")
45+ then (("https://images.wavespunks.com/mad/mutation/" + id) + ".gif")
46+ else (("https://images.wavespunks.com/mad/mutation/" + id) + ".png")
4747
4848
4949 func getTypePunk (id) = {
8888
8989 @Callable(i)
9090 func mint () = {
91- let totalPunksSupply = tryGetInteger("punks_supply")
92- let availablePunks = tryGetString("available_punks")
93- let preMintAddress = split(tryGetString("premint_address"), ",")
94- let startMint = tryGetInteger("start_mint")
95- let wavesNeeded = calcWavesNeeded()
96- let firstPayment = value(i.payments[0])
97- let firstPaymentBool = match firstPayment.assetId {
98- case t: ByteVector =>
99- true
100- case w: Unit =>
101- false
102- case _ =>
103- throw("Match error")
104- }
105- if ((totalPunksSupply == maxSupply))
106- then throw("All punks are minted")
107- else if ((availablePunks == ""))
108- then throw("No punks available")
109- else if (tryGetBoolean(toString(i.caller)))
110- then {
111- let temp = _mint(i, totalPunksSupply, availablePunks)
112- temp
113- }
114- else if ((startMint > lastBlock.timestamp))
115- then throw("Mint hasn`t yet begun")
116- else if (firstPaymentBool)
117- then throw("Payment must be in Waves tokens only")
118- else if ((wavesNeeded > firstPayment.amount))
119- then throw("Insufficient funds")
120- else _mint(i, totalPunksSupply, availablePunks)
91+ let punkId = toString(5)
92+ let name = ("MadPunk #" + punkId)
93+ let meta = tryGetString("collection_description")
94+ let asset = Issue(name, meta, 1, 0, false, unit, height)
95+ let assetId = calculateAssetId(asset)
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+ tx
12198 }
12299
123100
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let maxSupply = 1000
55
66 let waves = 100000000
77
88 func getPunkIDKey (id) = ("punk_" + id)
99
1010
1111 func tryGetInteger (key) = {
1212 let val = match getInteger(this, key) {
1313 case b: Int =>
1414 b
1515 case _ =>
1616 0
1717 }
1818 val
1919 }
2020
2121
2222 func tryGetBoolean (key) = {
2323 let val = match getBoolean(this, key) {
2424 case b: Boolean =>
2525 b
2626 case _ =>
2727 false
2828 }
2929 val
3030 }
3131
3232
3333 func tryGetString (key) = {
3434 let val = match getString(this, key) {
3535 case b: String =>
3636 b
3737 case _ =>
3838 ""
3939 }
4040 val
4141 }
4242
4343
4444 func getURL (id) = if (containsElement(split(tryGetString("gif_punk"), ","), id))
45- then (("https://mypunks.wavespunks.com/mad/m" + id) + ".gif")
46- else (("https://mypunks.wavespunks.com/mad/m" + id) + ".png")
45+ then (("https://images.wavespunks.com/mad/mutation/" + id) + ".gif")
46+ else (("https://images.wavespunks.com/mad/mutation/" + id) + ".png")
4747
4848
4949 func getTypePunk (id) = {
5050 let idINT = match parseInt(id) {
5151 case i: Int =>
5252 i
5353 case i: Unit =>
5454 0
5555 case _ =>
5656 throw("Match error")
5757 }
5858 if (containsElement(split(tryGetString("gif_punk"), ","), toString(idINT)))
5959 then "ultra-rare"
6060 else if ((29 >= idINT))
6161 then "rare"
6262 else "unique"
6363 }
6464
6565
6666 func getRandomNumber (variants,txId,heightBlock,offset) = {
6767 let randomSeedBlock = value(blockInfoByHeight((heightBlock - 1)))
6868 let randomHash = sha256_16Kb((txId + value(randomSeedBlock.vrf)))
6969 (toInt(randomHash, offset) % variants)
7070 }
7171
7272
7373 func calcWavesNeeded () = (waves * 6)
7474
7575
7676 func _mint (i,totalPunksSupply,availablePunks) = {
7777 let listAvailablePunks = split(availablePunks, ",")
7878 let rand = getRandomNumber((maxSupply - totalPunksSupply), i.transactionId, height, 0)
7979 let punkId = listAvailablePunks[rand]
8080 let name = ("MadPunk #" + punkId)
8181 let meta = tryGetString("collection_description")
8282 let asset = Issue(name, meta, 1, 0, false, unit, height)
8383 let assetId = calculateAssetId(asset)
8484 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)]
8585 tx
8686 }
8787
8888
8989 @Callable(i)
9090 func mint () = {
91- let totalPunksSupply = tryGetInteger("punks_supply")
92- let availablePunks = tryGetString("available_punks")
93- let preMintAddress = split(tryGetString("premint_address"), ",")
94- let startMint = tryGetInteger("start_mint")
95- let wavesNeeded = calcWavesNeeded()
96- let firstPayment = value(i.payments[0])
97- let firstPaymentBool = match firstPayment.assetId {
98- case t: ByteVector =>
99- true
100- case w: Unit =>
101- false
102- case _ =>
103- throw("Match error")
104- }
105- if ((totalPunksSupply == maxSupply))
106- then throw("All punks are minted")
107- else if ((availablePunks == ""))
108- then throw("No punks available")
109- else if (tryGetBoolean(toString(i.caller)))
110- then {
111- let temp = _mint(i, totalPunksSupply, availablePunks)
112- temp
113- }
114- else if ((startMint > lastBlock.timestamp))
115- then throw("Mint hasn`t yet begun")
116- else if (firstPaymentBool)
117- then throw("Payment must be in Waves tokens only")
118- else if ((wavesNeeded > firstPayment.amount))
119- then throw("Insufficient funds")
120- else _mint(i, totalPunksSupply, availablePunks)
91+ let punkId = toString(5)
92+ let name = ("MadPunk #" + punkId)
93+ let meta = tryGetString("collection_description")
94+ let asset = Issue(name, meta, 1, 0, false, unit, height)
95+ let assetId = calculateAssetId(asset)
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+ tx
12198 }
12299
123100
124101 @Verifier(tx)
125102 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
126103

github/deemru/w8io/026f985 
31.52 ms