tx · Y16vkZYdV4YVV8hFgBXjdD9WmbemtsjUHVYuDMBAKqH

3NBnH6Dmj3qoU6dc3kTRJ73mpPeuLg3f1WV:  -0.00900000 Waves

2022.08.17 19:39 [2188732] smart account 3NBnH6Dmj3qoU6dc3kTRJ73mpPeuLg3f1WV > SELF 0.00000000 Waves

{ "type": 13, "id": "Y16vkZYdV4YVV8hFgBXjdD9WmbemtsjUHVYuDMBAKqH", "fee": 900000, "feeAssetId": null, "timestamp": 1660754304812, "version": 2, "chainId": 84, "sender": "3NBnH6Dmj3qoU6dc3kTRJ73mpPeuLg3f1WV", "senderPublicKey": "E14HJsuErSNo18PaiCmFuGo8hj7ptMN6BvmGxztpHHcV", "proofs": [ "5CgKpi3jc4wkJKvHfq62cBUyNPC8kLxhsKEN5g5YSTPgsqgYP95X7731phs3LQBrzF8j2jAeWnJtoC1xpTbdhqqo" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAACgAAAAAJbWF4U3VwcGx5AAAAAAAAAAPoAAAAAAV3YXZlcwAAAAAABfXhAAEAAAAMZ2V0UHVua0lES2V5AAAAAQAAAAJpZAkAASwAAAACAgAAAAVwdW5rXwUAAAACaWQBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAAZnZXRVUkwAAAABAAAAAmlkAwkBAAAAD2NvbnRhaW5zRWxlbWVudAAAAAI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AAGYAAAACBQAAAAlzdGFydE1pbnQIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQAAAgAAAAECAAAAFU1pbnQgaGFzbmB0IHlldCBiZWd1bgMFAAAAEGZpcnN0UGF5bWVudEJvb2wJAAACAAAAAQIAAAAkUGF5bWVudCBtdXN0IGJlIGluIFdhdmVzIHRva2VucyBvbmx5AwkAAGYAAAACBQAAAAt3YXZlc05lZWRlZAgFAAAADGZpcnN0UGF5bWVudAAAAAZhbW91bnQJAAACAAAAAQIAAAASSW5zdWZmaWNpZW50IGZ1bmRzCQEAAAAFX21pbnQAAAADBQAAAAFpBQAAABB0b3RhbFB1bmtzU3VwcGx5BQAAAA5hdmFpbGFibGVQdW5rcwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5LYqRyw==", "height": 2188732, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: iYm12vQPzSsog2wTf7qtMe7tYgETaRnpvcTRDcfnLTd Next: BHgjGV7iYXqYQvSKG81S2ork7LMukMVBT2NNRch7My1g Diff:
OldNewDifferences
7070 let meta = tryGetString("collection_description")
7171 let asset = Issue(name, meta, 1, 0, false, unit, height)
7272 let assetId = calculateAssetId(asset)
73- 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)]
73+ let tx = [IntegerEntry("punks_supply", (totalPunksSupply + 1)), StringEntry("available_punks", makeString(removeByIndex(listAvailablePunks, rand), ",")), asset, StringEntry(getPunkIDKey(punkId), toBase58String(assetId)), StringEntry((toBase58String(assetId) + "_type"), getTypePunk(punkId)), StringEntry((toBase58String(assetId) + "_url"), getURL(punkId)), StringEntry((toBase58String(assetId) + "_fraction"), tryGetString("fraction")), ScriptTransfer(i.caller, 1, assetId)]
7474 tx
7575 }
7676
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 tryGetString (key) = {
2323 let val = match getString(this, key) {
2424 case b: String =>
2525 b
2626 case _ =>
2727 ""
2828 }
2929 val
3030 }
3131
3232
3333 func getURL (id) = if (containsElement(split(tryGetString("gif_punk"), ","), id))
3434 then (("https://mypunks.wavespunks.com/mad/m" + id) + ".gif")
3535 else (("https://mypunks.wavespunks.com/mad/m" + id) + ".png")
3636
3737
3838 func getTypePunk (id) = {
3939 let idINT = match parseInt(id) {
4040 case i: Int =>
4141 i
4242 case i: Unit =>
4343 0
4444 case _ =>
4545 throw("Match error")
4646 }
4747 if (containsElement(split(tryGetString("gif_punk"), ","), toString(idINT)))
4848 then "ultra-rare"
4949 else if ((29 >= idINT))
5050 then "rare"
5151 else "unique"
5252 }
5353
5454
5555 func getRandomNumber (variants,txId,heightBlock,offset) = {
5656 let randomSeedBlock = value(blockInfoByHeight((heightBlock - 1)))
5757 let randomHash = sha256_16Kb((txId + value(randomSeedBlock.vrf)))
5858 (toInt(randomHash, offset) % variants)
5959 }
6060
6161
6262 func calcWavesNeeded () = (waves * 6)
6363
6464
6565 func _mint (i,totalPunksSupply,availablePunks) = {
6666 let listAvailablePunks = split(availablePunks, ",")
6767 let rand = getRandomNumber((maxSupply - totalPunksSupply), i.transactionId, height, 0)
6868 let punkId = listAvailablePunks[rand]
6969 let name = ("MadPunk #" + punkId)
7070 let meta = tryGetString("collection_description")
7171 let asset = Issue(name, meta, 1, 0, false, unit, height)
7272 let assetId = calculateAssetId(asset)
73- 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)]
73+ let tx = [IntegerEntry("punks_supply", (totalPunksSupply + 1)), StringEntry("available_punks", makeString(removeByIndex(listAvailablePunks, rand), ",")), asset, StringEntry(getPunkIDKey(punkId), toBase58String(assetId)), StringEntry((toBase58String(assetId) + "_type"), getTypePunk(punkId)), StringEntry((toBase58String(assetId) + "_url"), getURL(punkId)), StringEntry((toBase58String(assetId) + "_fraction"), tryGetString("fraction")), ScriptTransfer(i.caller, 1, assetId)]
7474 tx
7575 }
7676
7777
7878 @Callable(i)
7979 func mint () = {
8080 let totalPunksSupply = tryGetInteger("punks_supply")
8181 let availablePunks = tryGetString("available_punks")
8282 let preMintAddress = split(tryGetString("premint_address"), ",")
8383 let startMint = tryGetInteger("start_mint")
8484 let wavesNeeded = calcWavesNeeded()
8585 let firstPayment = value(i.payments[0])
8686 let firstPaymentBool = match firstPayment.assetId {
8787 case t: ByteVector =>
8888 true
8989 case w: Unit =>
9090 false
9191 case _ =>
9292 throw("Match error")
9393 }
9494 if ((totalPunksSupply == maxSupply))
9595 then throw("All punks are minted")
9696 else if ((availablePunks == ""))
9797 then throw("No punks available")
9898 else if (containsElement(preMintAddress, toString(i.caller)))
9999 then {
100100 let index = match indexOf(preMintAddress, toString(i.caller)) {
101101 case b: Int =>
102102 b
103103 case b: Unit =>
104104 0
105105 case _ =>
106106 throw("Match error")
107107 }
108108 let temp = (_mint(i, totalPunksSupply, availablePunks) ++ [StringEntry("premint_address", makeString(removeByIndex(preMintAddress, index), ","))])
109109 temp
110110 }
111111 else if ((startMint > lastBlock.timestamp))
112112 then throw("Mint hasn`t yet begun")
113113 else if (firstPaymentBool)
114114 then throw("Payment must be in Waves tokens only")
115115 else if ((wavesNeeded > firstPayment.amount))
116116 then throw("Insufficient funds")
117117 else _mint(i, totalPunksSupply, availablePunks)
118118 }
119119
120120
121121 @Verifier(tx)
122122 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
123123

github/deemru/w8io/026f985 
29.99 ms