tx · BuoKREhqKiQAThykyeFCT6KqZ6x1dMKyfW8oWfq7LaPK 3Mpv2qZ8P3tXj3uKwmw8ULr9yxANxbadQEW: -0.01400000 Waves 2021.12.05 22:37 [1821397] smart account 3Mpv2qZ8P3tXj3uKwmw8ULr9yxANxbadQEW > SELF 0.00000000 Waves
{ "type": 13, "id": "BuoKREhqKiQAThykyeFCT6KqZ6x1dMKyfW8oWfq7LaPK", "fee": 1400000, "feeAssetId": null, "timestamp": 1638733088195, "version": 2, "chainId": 84, "sender": "3Mpv2qZ8P3tXj3uKwmw8ULr9yxANxbadQEW", "senderPublicKey": "J7yipDGS56f1CWQUaHM6k8TXt1iWw3DrzeqjSEUqL4Uv", "proofs": [ "4RUXMJSo6mryqk119b8F6QSoaFMQf6xWsSGyX11X92qe9ei8dm7otKzo9Xd4UcebsjxL6YygxwmAFkSCohBwV9Dp" ], "script": "base64:AAIFAAAAAAAAAA4IAhIDCgEIEgUKAwgBCAAAAAEBAAAAC2lzUGF5bWVudE9rAAAAAgAAAAFpAAAABXByaWNlBAAAABFhY2NlcHRhYmxlQXNzZXRJZAEAAAAgIkSm54hUfVEormpXug9p+nbhDnc37ahHq1IfaU2UQkcDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAB2Fzc2V0SWQFAAAAByRtYXRjaDADCQAAAAAAAAIFAAAAB2Fzc2V0SWQFAAAAEWFjY2VwdGFibGVBc3NldElkCQAAZwAAAAIIBQAAAAFwAAAABmFtb3VudAUAAAAFcHJpY2UHCQAAAgAAAAECAAAAE0JhZCBhc3NldCBvciBhbW91bnQA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CeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5SAdNcg==", "height": 1821397, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CsR1DrvcHYSyuZv9peDRaTJXuQSvDfULt5Vg63wkBwV2 Next: AcxkX1opERorSPW8ZZD8EULgYMU6K2eTp4pyKvvdXUxf Diff:
Old | New | Differences | |
---|---|---|---|
61 | 61 | let mdstid = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' | |
62 | 62 | let walletartist = addressFromStringValue(y[0]) | |
63 | 63 | let walletowner = addressFromStringValue(y[2]) | |
64 | - | let wl = "3MzXqo2rBxc3XEKPVcYHDrsgP7jmE6cGg6C" | |
65 | 64 | let issue = Issue(fname, z, 1, 0, false) | |
66 | 65 | let id = calculateAssetId(issue) | |
67 | 66 | let maxcnt = parseIntValue(y[9]) | |
68 | - | if ((cnt > maxcnt)) | |
67 | + | if (if ((cnt > maxcnt)) | |
68 | + | then (maxcnt != 0) | |
69 | + | else false) | |
69 | 70 | then throw("Mint impossible, max NFT amount exceeded") | |
70 | 71 | else if (isPaymentOk(i, money)) | |
71 | 72 | then [issue, ScriptTransfer(i.caller, 1, id), ScriptTransfer(walletartist, moneyartist, mdstid), ScriptTransfer(walletowner, moneyowner, mdstid)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func isPaymentOk (i,price) = { | |
5 | 5 | let acceptableAssetId = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' | |
6 | 6 | if ((size(i.payments) == 0)) | |
7 | 7 | then throw("Payment not attached") | |
8 | 8 | else { | |
9 | 9 | let p = i.payments[0] | |
10 | 10 | match p.assetId { | |
11 | 11 | case assetId: ByteVector => | |
12 | 12 | if ((assetId == acceptableAssetId)) | |
13 | 13 | then (p.amount >= price) | |
14 | 14 | else false | |
15 | 15 | case _ => | |
16 | 16 | throw("Bad asset or amount") | |
17 | 17 | } | |
18 | 18 | } | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func mintme (info) = { | |
24 | 24 | let counter = match getInteger(this, "counter") { | |
25 | 25 | case a: Int => | |
26 | 26 | (a + 1) | |
27 | 27 | case _ => | |
28 | 28 | 0 | |
29 | 29 | } | |
30 | 30 | let st = toString(counter) | |
31 | 31 | let name = "MDST-NFT #" | |
32 | 32 | let fname = (name + st) | |
33 | 33 | let issue = Issue(fname, info, 1, 0, false) | |
34 | 34 | let id = calculateAssetId(issue) | |
35 | 35 | [issue, ScriptTransfer(i.caller, issue.quantity, id), IntegerEntry("counter", counter)] | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Callable(i) | |
41 | 41 | func buynft (idnftx,cnt,newid) = { | |
42 | 42 | let st = toString(cnt) | |
43 | 43 | let fname = ("MDST-COPY#" + st) | |
44 | 44 | let info = "kiki bikit" | |
45 | 45 | let idnft = fromBase58String(idnftx) | |
46 | 46 | let x = match assetInfo(idnft) { | |
47 | 47 | case asset: Asset => | |
48 | 48 | asset.description | |
49 | 49 | case _ => | |
50 | 50 | throw("Can't find this NFT") | |
51 | 51 | } | |
52 | 52 | let y = split(x, ",") | |
53 | 53 | let spliturl = split(y[4], "=") | |
54 | 54 | let newurl = ((spliturl[0] + "=") + newid) | |
55 | 55 | let z = ((((((((((((((((((((((y[0] + ",") + y[1]) + ",") + y[2]) + ",") + y[3]) + ",") + y[4]) + ",") + newurl) + ",") + y[6]) + ",") + "false") + ",") + y[8]) + ",") + y[9]) + ",") + st) + ",") + y[11]) | |
56 | 56 | let price = y[8] | |
57 | 57 | let money = (size(i.payments) * 10000) | |
58 | 58 | let moneyartist = (money / 2) | |
59 | 59 | let moneyowner = (money / 4) | |
60 | 60 | let moneyus = (money / 4) | |
61 | 61 | let mdstid = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' | |
62 | 62 | let walletartist = addressFromStringValue(y[0]) | |
63 | 63 | let walletowner = addressFromStringValue(y[2]) | |
64 | - | let wl = "3MzXqo2rBxc3XEKPVcYHDrsgP7jmE6cGg6C" | |
65 | 64 | let issue = Issue(fname, z, 1, 0, false) | |
66 | 65 | let id = calculateAssetId(issue) | |
67 | 66 | let maxcnt = parseIntValue(y[9]) | |
68 | - | if ((cnt > maxcnt)) | |
67 | + | if (if ((cnt > maxcnt)) | |
68 | + | then (maxcnt != 0) | |
69 | + | else false) | |
69 | 70 | then throw("Mint impossible, max NFT amount exceeded") | |
70 | 71 | else if (isPaymentOk(i, money)) | |
71 | 72 | then [issue, ScriptTransfer(i.caller, 1, id), ScriptTransfer(walletartist, moneyartist, mdstid), ScriptTransfer(walletowner, moneyowner, mdstid)] | |
72 | 73 | else throw("Wrong payment amount or asset") | |
73 | 74 | } | |
74 | 75 | ||
75 | 76 | ||
76 | 77 | @Verifier(tx) | |
77 | 78 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
78 | 79 |
github/deemru/w8io/026f985 31.68 ms ◑