tx · 9KuPJhf4kwYsJ8RdqEW8V8h2TnFHDHgmmpuvYH2ZJw6x 3Mtd4RQC3qHhoHWgPUR7RpNYFEivwpFHkYq: -0.01000000 Waves 2022.05.31 14:22 [2075773] smart account 3Mtd4RQC3qHhoHWgPUR7RpNYFEivwpFHkYq > SELF 0.00000000 Waves
{ "type": 13, "id": "9KuPJhf4kwYsJ8RdqEW8V8h2TnFHDHgmmpuvYH2ZJw6x", "fee": 1000000, "feeAssetId": null, "timestamp": 1653996155348, "version": 2, "chainId": 84, "sender": "3Mtd4RQC3qHhoHWgPUR7RpNYFEivwpFHkYq", "senderPublicKey": "BkZymxA8ygsGWTCtwH8BCBtp9pY7vgEHUbt5JcRqSDxk", "proofs": [ "2rP7RNxYZoFqvSbHNsmujjE8UPZe5gSrnBRtepcLztasLAAk5pcH2z5bWuNTewRmdznqPrjekcCg739taqRc6nKh" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAABAAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAACkJBU0VfUFJJQ0UAAAAAAAL68IAAAAAABFBMVVMAAAAAAAAPQkABAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIcHJpY2VLZXkCAAAACmxhc3RfcHJpY2UEAAAACmludGVnZXJWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAAIcHJpY2VLZXkFAAAACkJBU0VfUFJJQ0UEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2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AAAAAABwQAAAAIbmV3UHJpY2UJAABkAAAAAgUAAAAKaW50ZWdlclZhbAUAAAAEUExVUwQAAAADaWRhCQAEOAAAAAEFAAAABmlzc3VlcgkABEwAAAACBQAAAAZpc3N1ZXIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAETkZUXwkAAaQAAAABBQAAAAJpZAIAAAABXwUAAAAMd2FsbGV0U3RyaW5nCQACWAAAAAEFAAAAA2lkYQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAA2lkYQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAIcHJpY2VLZXkFAAAACG5ld1ByaWNlBQAAAANuaWwJAAACAAAAAQIAAAAeYWxyZWFkeSBtaW50ZWQgYnkgc29tZW9uZSBlbHNlCQAAAgAAAAECAAAAHldyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0LgkAAAIAAAABAgAAAAxvdXQgb2YgcmFuZ2UAAAAAOML89A==", "height": 2075773, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 81UUh2dLbC8L4cM8GTemDHGa9sxSgmnZTPXWuHzMsmpt Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' | |
5 | + | ||
6 | + | let BASE_PRICE = 50000000 | |
7 | + | ||
8 | + | let PLUS = 1000000 | |
9 | + | ||
10 | + | func isPaymentOk (i) = { | |
11 | + | let acceptableAssetId = PAYMENT_ASSET | |
12 | + | if ((size(i.payments) == 0)) | |
13 | + | then throw("Payment not attached") | |
14 | + | else { | |
15 | + | let p = i.payments[0] | |
16 | + | let priceKey = "last_price" | |
17 | + | let integerVal = valueOrElse(getInteger(this, priceKey), BASE_PRICE) | |
18 | + | match p.assetId { | |
19 | + | case assetId: ByteVector => | |
20 | + | if ((assetId == PAYMENT_ASSET)) | |
21 | + | then (p.amount == integerVal) | |
22 | + | else false | |
23 | + | case _ => | |
24 | + | throw("Wrong payment asset or min amount 50 USDN") | |
25 | + | } | |
26 | + | } | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | @Callable(i) | |
31 | + | func mintPokemon (id) = { | |
32 | + | let walletString = toBase58String(i.caller.bytes) | |
33 | + | let priceKey = "last_price" | |
34 | + | let integerVal = valueOrElse(getInteger(this, priceKey), BASE_PRICE) | |
35 | + | if (if ((id > 0)) | |
36 | + | then true | |
37 | + | else (151 >= id)) | |
38 | + | then if (isPaymentOk(i)) | |
39 | + | then { | |
40 | + | let stringId = toString(id) | |
41 | + | let idCheck = valueOrElse(getString(this, stringId), "none") | |
42 | + | let toSet = ((toString(id) + "_w_") + walletString) | |
43 | + | let NFTNAME = ("POKEMON_NFT" + toString(id)) | |
44 | + | if ((idCheck == "none")) | |
45 | + | then { | |
46 | + | let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false) | |
47 | + | let newPrice = (integerVal + PLUS) | |
48 | + | let ida = calculateAssetId(issuer) | |
49 | + | [issuer, StringEntry(((("NFT_" + toString(id)) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)] | |
50 | + | } | |
51 | + | else throw("already minted by someone else") | |
52 | + | } | |
53 | + | else throw("Wrong payment amount or asset.") | |
54 | + | else throw("out of range") | |
55 | + | } | |
56 | + | ||
57 | + |
github/deemru/w8io/169f3d6 16.47 ms ◑