tx · 8VytVK5dwDaBeQxQLEvUXteFUEK9x1Dt8f4eDHNiF2ob 3MsnFBX1La8i9WoAQetZcPaiQTqC4giPUde: -0.01000000 Waves 2022.05.31 16:07 [2075877] smart account 3MsnFBX1La8i9WoAQetZcPaiQTqC4giPUde > SELF 0.00000000 Waves
{ "type": 13, "id": "8VytVK5dwDaBeQxQLEvUXteFUEK9x1Dt8f4eDHNiF2ob", "fee": 1000000, "feeAssetId": null, "timestamp": 1654002477076, "version": 2, "chainId": 84, "sender": "3MsnFBX1La8i9WoAQetZcPaiQTqC4giPUde", "senderPublicKey": "9tg59aPk9dET4s3sb4NY1zWHGtSKE7maNNvYe8aDBxZn", "proofs": [ "Jwx15XuQi12BEoer4UnSDQNZWWwzknKPwJCgj5SCqoeDKX3SpttKWioMh2DrjSgfoPduEhESgRfgxVgwcuhGLKx" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAABAAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAACkJBU0VfUFJJQ0UAAAAAAAL68IAAAAAABFBMVVMAAAAAAAAPQkABAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIcHJpY2VLZXkCAAAACmxhc3RfcHJpY2UEAAAACmludGVnZXJWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAAIcHJpY2VLZXkFAAAACkJBU0VfUFJJQ0UEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAAAAIF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AAACCQAEtgAAAAEJAAGRAAAAAgUAAAAIc3BsaXR0ZXIAAAAAAAAAAAEFAAAAAmlkBAAAAAZpc3N1ZXIJAARCAAAABQUAAAAHTkZUTkFNRQkAASwAAAACAgAAAAxQT0tFTU9OX05GVF8JAAGkAAAAAQUAAAACaWQAAAAAAAAAAAEAAAAAAAAAAAAHBAAAAAhuZXdQcmljZQkAAGQAAAACBQAAAAppbnRlZ2VyVmFsBQAAAARQTFVTBAAAAANpZGEJAAQ4AAAAAQUAAAAGaXNzdWVyCQAETAAAAAIFAAAABmlzc3VlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAARORlRfCQABpAAAAAEFAAAAAmlkAgAAAAFfBQAAAAx3YWxsZXRTdHJpbmcJAAJYAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAADaWRhCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAhwcmljZUtleQUAAAAIbmV3UHJpY2UFAAAAA25pbAkAAAIAAAABAgAAAB5hbHJlYWR5IG1pbnRlZCBieSBzb21lb25lIGVsc2UJAAACAAAAAQIAAAAeV3JvbmcgcGF5bWVudCBhbW91bnQgb3IgYXNzZXQuCQAAAgAAAAECAAAADG91dCBvZiByYW5nZQAAAABIkQi5", "height": 2075877, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 7kcZB1etse27pmqEC4gPaLvyTEHCmPMmhH9FKc3z9TzR 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) + "_") + walletString) + "_NFT") | |
41 | + | let idCheck = valueOrElse(getString(this, stringId), "none") | |
42 | + | let toSet = ((toString(id) + "_w_") + walletString) | |
43 | + | let NFTNAME = ("POKEMON_NFT_" + toString(id)) | |
44 | + | let splitter = split("_", idCheck) | |
45 | + | if (if ((idCheck == "none")) | |
46 | + | then true | |
47 | + | else (parseInt(splitter[1]) != id)) | |
48 | + | then { | |
49 | + | let issuer = Issue(NFTNAME, ("POKEMON_NFT_" + toString(id)), 1, 0, false) | |
50 | + | let newPrice = (integerVal + PLUS) | |
51 | + | let ida = calculateAssetId(issuer) | |
52 | + | [issuer, StringEntry(((("NFT_" + toString(id)) + "_") + walletString), toBase58String(ida)), ScriptTransfer(i.caller, 1, ida), IntegerEntry(priceKey, newPrice)] | |
53 | + | } | |
54 | + | else throw("already minted by someone else") | |
55 | + | } | |
56 | + | else throw("Wrong payment amount or asset.") | |
57 | + | else throw("out of range") | |
58 | + | } | |
59 | + | ||
60 | + |
github/deemru/w8io/169f3d6 28.43 ms ◑