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:AAIFAAAAAAAAAAcIAhIDCgEBAAAABAAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAACkJBU0VfUFJJQ0UAAAAAAAL68IAAAAAABFBMVVMAAAAAAAAPQkABAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIcHJpY2VLZXkCAAAACmxhc3RfcHJpY2UEAAAACmludGVnZXJWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAAIcHJpY2VLZXkFAAAACkJBU0VfUFJJQ0UEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAAA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T0AAAACCQAEtgAAAAEJAAGRAAAAAgUAAAAIc3BsaXR0ZXIAAAAAAAAAAAEFAAAAAmlkBAAAAAZpc3N1ZXIJAARCAAAABQUAAAAHTkZUTkFNRQkAASwAAAACAgAAAAxQT0tFTU9OX05GVF8JAAGkAAAAAQUAAAACaWQAAAAAAAAAAAEAAAAAAAAAAAAHBAAAAAhuZXdQcmljZQkAAGQAAAACBQAAAAppbnRlZ2VyVmFsBQAAAARQTFVTBAAAAANpZGEJAAQ4AAAAAQUAAAAGaXNzdWVyCQAETAAAAAIFAAAABmlzc3VlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABpAAAAAEFAAAAAmlkAgAAAAFfBQAAAAx3YWxsZXRTdHJpbmcCAAAABF9ORlQJAAJYAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAhwcmljZUtleQUAAAAIbmV3UHJpY2UFAAAAA25pbAkAAAIAAAABAgAAAB5hbHJlYWR5IG1pbnRlZCBieSBzb21lb25lIGVsc2UJAAACAAAAAQIAAAAeV3JvbmcgcGF5bWVudCBhbW91bnQgb3IgYXNzZXQuCQAAAgAAAAECAAAADG91dCBvZiByYW5nZQAAAABtilOS", "height": 2075879, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8VytVK5dwDaBeQxQLEvUXteFUEK9x1Dt8f4eDHNiF2ob Next: none Diff:
Old | New | Differences | |
---|---|---|---|
49 | 49 | let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false) | |
50 | 50 | let newPrice = (integerVal + PLUS) | |
51 | 51 | let ida = calculateAssetId(issuer) | |
52 | - | [issuer, StringEntry(((( | |
52 | + | [issuer, StringEntry((((toString(id) + "_") + walletString) + "_NFT"), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)] | |
53 | 53 | } | |
54 | 54 | else throw("already minted by someone else") | |
55 | 55 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | 5 | ||
6 | 6 | let BASE_PRICE = 50000000 | |
7 | 7 | ||
8 | 8 | let PLUS = 1000000 | |
9 | 9 | ||
10 | 10 | func isPaymentOk (i) = { | |
11 | 11 | let acceptableAssetId = PAYMENT_ASSET | |
12 | 12 | if ((size(i.payments) == 0)) | |
13 | 13 | then throw("Payment not attached") | |
14 | 14 | else { | |
15 | 15 | let p = i.payments[0] | |
16 | 16 | let priceKey = "last_price" | |
17 | 17 | let integerVal = valueOrElse(getInteger(this, priceKey), BASE_PRICE) | |
18 | 18 | match p.assetId { | |
19 | 19 | case assetId: ByteVector => | |
20 | 20 | if ((assetId == PAYMENT_ASSET)) | |
21 | 21 | then (p.amount == integerVal) | |
22 | 22 | else false | |
23 | 23 | case _ => | |
24 | 24 | throw("Wrong payment asset or min amount 50 USDN") | |
25 | 25 | } | |
26 | 26 | } | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | @Callable(i) | |
31 | 31 | func mintPokemon (id) = { | |
32 | 32 | let walletString = toBase58String(i.caller.bytes) | |
33 | 33 | let priceKey = "last_price" | |
34 | 34 | let integerVal = valueOrElse(getInteger(this, priceKey), BASE_PRICE) | |
35 | 35 | if (if ((id > 0)) | |
36 | 36 | then true | |
37 | 37 | else (151 >= id)) | |
38 | 38 | then if (isPaymentOk(i)) | |
39 | 39 | then { | |
40 | 40 | let stringId = (((toString(id) + "_") + walletString) + "_NFT") | |
41 | 41 | let idCheck = valueOrElse(getString(this, stringId), "none") | |
42 | 42 | let toSet = ((toString(id) + "_w_") + walletString) | |
43 | 43 | let NFTNAME = ("POKEMON_NFT_" + toString(id)) | |
44 | 44 | let splitter = split("_", idCheck) | |
45 | 45 | if (if ((idCheck == "none")) | |
46 | 46 | then true | |
47 | 47 | else (parseInt(splitter[1]) != id)) | |
48 | 48 | then { | |
49 | 49 | let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false) | |
50 | 50 | let newPrice = (integerVal + PLUS) | |
51 | 51 | let ida = calculateAssetId(issuer) | |
52 | - | [issuer, StringEntry(((( | |
52 | + | [issuer, StringEntry((((toString(id) + "_") + walletString) + "_NFT"), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)] | |
53 | 53 | } | |
54 | 54 | else throw("already minted by someone else") | |
55 | 55 | } | |
56 | 56 | else throw("Wrong payment amount or asset.") | |
57 | 57 | else throw("out of range") | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 |
github/deemru/w8io/169f3d6 27.64 ms ◑