tx · 8aTGCBmPmzECJBBbTE2yWwLtWy1c37UyGKnsiS5vu9nd

3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT:  -0.01000000 Waves

2022.05.31 14:09 [2075760] smart account 3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT > SELF 0.00000000 Waves

{ "type": 13, "id": "8aTGCBmPmzECJBBbTE2yWwLtWy1c37UyGKnsiS5vu9nd", "fee": 1000000, "feeAssetId": null, "timestamp": 1653995402444, "version": 2, "chainId": 84, "sender": "3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT", "senderPublicKey": "5FCKdCQ3s4naiaoX3iSwKqTAHzcVkGi6M48BnWuHjJ5u", "proofs": [ "SL6wGQ1pTLsB2Zuhf1qqQjDSC1SqHtgUFh9yKgFdq4pLMS8iv7XMtQSJAX1429XTuoL5o68NrDyM96J9pyn9HXm" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAAgAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQBAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIcHJpY2VLZXkCAAAACmxhc3RfcHJpY2UEAAAACmludGVnZXJWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMFAAAACHByaWNlS2V5AAAAAAAC+vCABAAAAAckbWF0Y2gwCAUAAAABcAAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9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AAAAAAAAmJaABAAAAANpZGEJAAQ4AAAAAQUAAAAGaXNzdWVyCQAETAAAAAIFAAAABmlzc3VlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAAaQAAAABBQAAAAJpZAIAAAABXwUAAAAMd2FsbGV0U3RyaW5nCQACWAAAAAEFAAAAA2lkYQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAA2lkYQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAIcHJpY2VLZXkFAAAACG5ld1ByaWNlBQAAAANuaWwJAAACAAAAAQIAAAAeYWxyZWFkeSBtaW50ZWQgYnkgc29tZW9uZSBlbHNlCQAAAgAAAAECAAAAHldyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0LgkAAAIAAAABAgAAAAxvdXQgb2YgcmFuZ2UAAAAAmMkacA==", "height": 2075760, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4sAGBHEq69F3Rh4hh2EoaHJ5tuN7pUDGLVF8noauAmLV Next: 5KtjavABwZBTHtYHrYzWyezVasZgtHzkNY2hNB5S2Jft Diff:
OldNewDifferences
1010 else {
1111 let p = i.payments[0]
1212 let priceKey = "last_price"
13- let integerVal = 50000000
13+ let integerVal = valueOrElse(getIntegerValue(this, priceKey), 50000000)
1414 match p.assetId {
1515 case assetId: ByteVector =>
1616 if ((assetId == PAYMENT_ASSET))
4242 let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false)
4343 let newPrice = (integerVal + 10000000)
4444 let ida = calculateAssetId(issuer)
45- valueOrErrorMessage([issuer, StringEntry(((toString(id) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)], "an error occured")
45+[issuer, StringEntry(((toString(id) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)]
4646 }
4747 else throw("already minted by someone else")
4848 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh'
55
66 func isPaymentOk (i) = {
77 let acceptableAssetId = PAYMENT_ASSET
88 if ((size(i.payments) == 0))
99 then throw("Payment not attached")
1010 else {
1111 let p = i.payments[0]
1212 let priceKey = "last_price"
13- let integerVal = 50000000
13+ let integerVal = valueOrElse(getIntegerValue(this, priceKey), 50000000)
1414 match p.assetId {
1515 case assetId: ByteVector =>
1616 if ((assetId == PAYMENT_ASSET))
1717 then (p.amount == integerVal)
1818 else false
1919 case _ =>
2020 throw("Wrong payment asset or min amount 50 USDN")
2121 }
2222 }
2323 }
2424
2525
2626 @Callable(i)
2727 func mintPokemon (id) = {
2828 let walletString = toBase58String(i.caller.bytes)
2929 let priceKey = "last_price"
3030 let integerVal = valueOrElse(getIntegerValue(this, priceKey), 0)
3131 if (if ((id > 0))
3232 then true
3333 else (151 >= id))
3434 then if (isPaymentOk(i))
3535 then {
3636 let stringId = toString(id)
3737 let idCheck = valueOrElse(getString(this, stringId), "none")
3838 let toSet = ((toString(id) + "_w_") + walletString)
3939 let NFTNAME = ("POKEMON_NFT" + toString(id))
4040 if ((idCheck == "none"))
4141 then {
4242 let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false)
4343 let newPrice = (integerVal + 10000000)
4444 let ida = calculateAssetId(issuer)
45- valueOrErrorMessage([issuer, StringEntry(((toString(id) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)], "an error occured")
45+[issuer, StringEntry(((toString(id) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)]
4646 }
4747 else throw("already minted by someone else")
4848 }
4949 else throw("Wrong payment amount or asset.")
5050 else throw("out of range")
5151 }
5252
5353

github/deemru/w8io/169f3d6 
36.63 ms