tx · 2ui9HngL45hMbzpu7KFXjXRYRuq2Jzuh8gjdLcn2dkHy 3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT: -0.01000000 Waves 2022.05.31 13:55 [2075744] smart account 3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT > SELF 0.00000000 Waves
{ "type": 13, "id": "2ui9HngL45hMbzpu7KFXjXRYRuq2Jzuh8gjdLcn2dkHy", "fee": 1000000, "feeAssetId": null, "timestamp": 1653994577051, "version": 2, "chainId": 84, "sender": "3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT", "senderPublicKey": "5FCKdCQ3s4naiaoX3iSwKqTAHzcVkGi6M48BnWuHjJ5u", "proofs": [ "P1H4z73jT98Y7XbVhb4VmzmsUWioQ6vRtvodekLwuWq3xgdfCkL6VWQQw5KksLAHQepSC6bAckRUuLhZFkQRPwf" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAAgAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQBAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIcHJpY2VLZXkCAAAACmxhc3RfcHJpY2UEAAAACmludGVnZXJWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMFAAAACHByaWNlS2V5AAAAAAAC+vCABAAAAAckbWF0Y2gwCAUAAAABcAAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBA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nRlZ2VyVmFsAAAAAAAAmJaABAAAAANpZGEJAAQ4AAAAAQUAAAAGaXNzdWVyCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAARMAAAAAgUAAAAGaXNzdWVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABpAAAAAEFAAAAAmlkAgAAAAFfBQAAAAx3YWxsZXRTdHJpbmcJAAJYAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAhwcmljZUtleQUAAAAIbmV3UHJpY2UFAAAAA25pbAIAAAAQYW4gZXJyb3Igb2NjdXJlZAkAAAIAAAABAgAAAB5hbHJlYWR5IG1pbnRlZCBieSBzb21lb25lIGVsc2UJAAACAAAAAQIAAAAeV3JvbmcgcGF5bWVudCBhbW91bnQgb3IgYXNzZXQuCQAAAgAAAAECAAAADG91dCBvZiByYW5nZQAAAABSsAwc", "height": 2075744, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GzKLNWueaFXZYrDjnb2FfCqX3hcmYyyRTZCEaTFSUXLZ Next: FXzeqQxNGRTATwXwGiQSzYS2NkSXncYzYrwUUPeiqv5D Diff:
Old | New | Differences | |
---|---|---|---|
19 | 19 | case _ => | |
20 | 20 | throw("Wrong payment asset or min amount 50 USDN") | |
21 | 21 | } | |
22 | - | } | |
23 | - | } | |
24 | - | ||
25 | - | ||
26 | - | func pricer () = { | |
27 | - | let priceKey = "last_price" | |
28 | - | let integerVal = valueOrElse(getIntegerValue(this, priceKey), 0) | |
29 | - | if ((integerVal == 0)) | |
30 | - | then [IntegerEntry(priceKey, 50000000)] | |
31 | - | else { | |
32 | - | let newPrice = (integerVal + 10000000) | |
33 | - | [IntegerEntry(priceKey, newPrice)] | |
34 | 22 | } | |
35 | 23 | } | |
36 | 24 |
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 | func isPaymentOk (i) = { | |
7 | 7 | let acceptableAssetId = PAYMENT_ASSET | |
8 | 8 | if ((size(i.payments) == 0)) | |
9 | 9 | then throw("Payment not attached") | |
10 | 10 | else { | |
11 | 11 | let p = i.payments[0] | |
12 | 12 | let priceKey = "last_price" | |
13 | 13 | let integerVal = valueOrElse(getIntegerValue(this, priceKey), 50000000) | |
14 | 14 | match p.assetId { | |
15 | 15 | case assetId: ByteVector => | |
16 | 16 | if ((assetId == PAYMENT_ASSET)) | |
17 | 17 | then (p.amount == integerVal) | |
18 | 18 | else false | |
19 | 19 | case _ => | |
20 | 20 | throw("Wrong payment asset or min amount 50 USDN") | |
21 | 21 | } | |
22 | - | } | |
23 | - | } | |
24 | - | ||
25 | - | ||
26 | - | func pricer () = { | |
27 | - | let priceKey = "last_price" | |
28 | - | let integerVal = valueOrElse(getIntegerValue(this, priceKey), 0) | |
29 | - | if ((integerVal == 0)) | |
30 | - | then [IntegerEntry(priceKey, 50000000)] | |
31 | - | else { | |
32 | - | let newPrice = (integerVal + 10000000) | |
33 | - | [IntegerEntry(priceKey, newPrice)] | |
34 | 22 | } | |
35 | 23 | } | |
36 | 24 | ||
37 | 25 | ||
38 | 26 | @Callable(i) | |
39 | 27 | func mintPokemon (id) = { | |
40 | 28 | let walletString = toBase58String(i.caller.bytes) | |
41 | 29 | if (if ((id > 0)) | |
42 | 30 | then true | |
43 | 31 | else (151 >= id)) | |
44 | 32 | then if (isPaymentOk(i)) | |
45 | 33 | then { | |
46 | 34 | let stringId = toString(id) | |
47 | 35 | let idCheck = valueOrElse(getString(this, stringId), "none") | |
48 | 36 | let toSet = ((toString(id) + "_w_") + walletString) | |
49 | 37 | let NFTNAME = ("POKEMON_NFT" + toString(id)) | |
50 | 38 | if ((idCheck == "none")) | |
51 | 39 | then { | |
52 | 40 | let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false) | |
53 | 41 | let priceKey = "last_price" | |
54 | 42 | let integerVal = valueOrElse(getIntegerValue(this, priceKey), 0) | |
55 | 43 | let newPrice = (integerVal + 10000000) | |
56 | 44 | let ida = calculateAssetId(issuer) | |
57 | 45 | valueOrErrorMessage([issuer, StringEntry(((toString(id) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)], "an error occured") | |
58 | 46 | } | |
59 | 47 | else throw("already minted by someone else") | |
60 | 48 | } | |
61 | 49 | else throw("Wrong payment amount or asset.") | |
62 | 50 | else throw("out of range") | |
63 | 51 | } | |
64 | 52 | ||
65 | 53 |
github/deemru/w8io/169f3d6 38.39 ms ◑