tx · 7kcZB1etse27pmqEC4gPaLvyTEHCmPMmhH9FKc3z9TzR

3MsnFBX1La8i9WoAQetZcPaiQTqC4giPUde:  -0.01000000 Waves

2022.05.31 16:09 [2075879] smart account 3MsnFBX1La8i9WoAQetZcPaiQTqC4giPUde > SELF 0.00000000 Waves

{ "type": 13, "id": "7kcZB1etse27pmqEC4gPaLvyTEHCmPMmhH9FKc3z9TzR", "fee": 1000000, "feeAssetId": null, "timestamp": 1654002560028, "version": 2, "chainId": 84, "sender": "3MsnFBX1La8i9WoAQetZcPaiQTqC4giPUde", "senderPublicKey": "9tg59aPk9dET4s3sb4NY1zWHGtSKE7maNNvYe8aDBxZn", "proofs": [ "3xRVFDnR3jqC5Ge6qaZqR7cfPLgsyU3t4kTVCy7ETUWZf15E3osDAsZcT1iSzzcpbRVhLKCTKpiSHN8zXeB8K5SE" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAABAAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAACkJBU0VfUFJJQ0UAAAAAAAL68IAAAAAABFBMVVMAAAAAAAAPQkABAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIcHJpY2VLZXkCAAAACmxhc3RfcHJpY2UEAAAACmludGVnZXJWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAAIcHJpY2VLZXkFAAAACkJBU0VfUFJJQ0UEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAA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IT0AAAACCQAEtgAAAAEJAAGRAAAAAgUAAAAIc3BsaXR0ZXIAAAAAAAAAAAEFAAAAAmlkBAAAAAZpc3N1ZXIJAARCAAAABQUAAAAHTkZUTkFNRQkAASwAAAACAgAAAAxQT0tFTU9OX05GVF8JAAGkAAAAAQUAAAACaWQAAAAAAAAAAAEAAAAAAAAAAAAHBAAAAAhuZXdQcmljZQkAAGQAAAACBQAAAAppbnRlZ2VyVmFsBQAAAARQTFVTBAAAAANpZGEJAAQ4AAAAAQUAAAAGaXNzdWVyCQAETAAAAAIFAAAABmlzc3VlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABpAAAAAEFAAAAAmlkAgAAAAFfBQAAAAx3YWxsZXRTdHJpbmcCAAAABF9ORlQJAAJYAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAhwcmljZUtleQUAAAAIbmV3UHJpY2UFAAAAA25pbAkAAAIAAAABAgAAAB5hbHJlYWR5IG1pbnRlZCBieSBzb21lb25lIGVsc2UJAAACAAAAAQIAAAAeV3JvbmcgcGF5bWVudCBhbW91bnQgb3IgYXNzZXQuCQAAAgAAAAECAAAADG91dCBvZiByYW5nZQAAAABtilOS", "height": 2075879, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8VytVK5dwDaBeQxQLEvUXteFUEK9x1Dt8f4eDHNiF2ob Next: none Diff:
OldNewDifferences
4949 let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false)
5050 let newPrice = (integerVal + PLUS)
5151 let ida = calculateAssetId(issuer)
52-[issuer, StringEntry(((("NFT_" + toString(id)) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)]
52+[issuer, StringEntry((((toString(id) + "_") + walletString) + "_NFT"), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)]
5353 }
5454 else throw("already minted by someone else")
5555 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
55
66 let BASE_PRICE = 50000000
77
88 let PLUS = 1000000
99
1010 func isPaymentOk (i) = {
1111 let acceptableAssetId = PAYMENT_ASSET
1212 if ((size(i.payments) == 0))
1313 then throw("Payment not attached")
1414 else {
1515 let p = i.payments[0]
1616 let priceKey = "last_price"
1717 let integerVal = valueOrElse(getInteger(this, priceKey), BASE_PRICE)
1818 match p.assetId {
1919 case assetId: ByteVector =>
2020 if ((assetId == PAYMENT_ASSET))
2121 then (p.amount == integerVal)
2222 else false
2323 case _ =>
2424 throw("Wrong payment asset or min amount 50 USDN")
2525 }
2626 }
2727 }
2828
2929
3030 @Callable(i)
3131 func mintPokemon (id) = {
3232 let walletString = toBase58String(i.caller.bytes)
3333 let priceKey = "last_price"
3434 let integerVal = valueOrElse(getInteger(this, priceKey), BASE_PRICE)
3535 if (if ((id > 0))
3636 then true
3737 else (151 >= id))
3838 then if (isPaymentOk(i))
3939 then {
4040 let stringId = (((toString(id) + "_") + walletString) + "_NFT")
4141 let idCheck = valueOrElse(getString(this, stringId), "none")
4242 let toSet = ((toString(id) + "_w_") + walletString)
4343 let NFTNAME = ("POKEMON_NFT_" + toString(id))
4444 let splitter = split("_", idCheck)
4545 if (if ((idCheck == "none"))
4646 then true
4747 else (parseInt(splitter[1]) != id))
4848 then {
4949 let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false)
5050 let newPrice = (integerVal + PLUS)
5151 let ida = calculateAssetId(issuer)
52-[issuer, StringEntry(((("NFT_" + toString(id)) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)]
52+[issuer, StringEntry((((toString(id) + "_") + walletString) + "_NFT"), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)]
5353 }
5454 else throw("already minted by someone else")
5555 }
5656 else throw("Wrong payment amount or asset.")
5757 else throw("out of range")
5858 }
5959
6060

github/deemru/w8io/169f3d6 
27.64 ms