tx · FaMJ1CiQ4NChrg6EwGxVS1eaNs4DJsAB4gATKKfgF2SJ 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6: -0.01000000 Waves 2021.06.30 21:24 [1593474] smart account 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6 > SELF 0.00000000 Waves
{ "type": 13, "id": "FaMJ1CiQ4NChrg6EwGxVS1eaNs4DJsAB4gATKKfgF2SJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1625077523376, "version": 2, "chainId": 84, "sender": "3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6", "senderPublicKey": "4f5Wt4MDH3Qt6DMuZQid3zoj463xCUkNdUWjUcChuedh", "proofs": [ "bzhNFek2ptUmvvuuU5Ad1jQHtg6s3QWPjhYvCdFdrJDdEnKdA1eUTSFwczMENcsmasVQzvApWJ2hbxoHBKDFFq2" ], "script": "base64:AAIFAAAAAAAAABYIAhIDCgEIEgMKAQgSAwoBCBIDCgEIAAAAAwAAAAADSlBOAQAAACBFqLGvjcwUgk68Uea/woMfyoMncahjkWcixg2ZF+iMxQAAAAAER09MRAEAAAAgLR44CaQZZUypJtV0fmMzG/7TvBdMmwMi7yR7k3IM0LwAAAAACUJMT0NLU1RFUAAAAAAAAAAACgAAAAQAAAABaQEAAAAHYnV5VW5pdAAAAAEAAAAHYXNzZXRJRAQAAAAEY29zdAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAABWNvc3RfBQAAAAdhc3NldElEAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5AwkB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3NldElEAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAABmNhbGxlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAduZXdXYWl0CQAAZAAAAAIIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0BQAAAAlCTE9DS1NURVADCQEAAAACIT0AAAACBQAAAAZjYWxsZXIFAAAABW93bmVyCQAAAgAAAAECAAAAEllvdSBhcmUgbm90IG93bmVyIQMJAABmAAAAAgUAAAAEd2FpdAgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAAACAAAAAQkAASwAAAACCQABLAAAAAICAAAAEVN0aWxsIHdhaXQgYmxvY2sgCQABpAAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AgAAABIgZm9yIG5ldyBhZHZlbnR1cmUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAB6EgBQAAAANKUE4JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFd2FpdF8FAAAAB2Fzc2V0SUQFAAAAB25ld1dhaXQFAAAAA25pbAAAAABFHrkm", "height": 1593474, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BmBn2N8FN3kBp5iCMvYuidkkwNoqVVAA1WywhH57VCL2 Next: ChU8GmggvyKtTNc3BYh8DGjNs555DQHAUnujr1YzHUUe Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | case _ => | |
35 | 35 | throw("Can't find asset") | |
36 | 36 | } | |
37 | - | throw(x) | |
37 | + | let dataArray = split(x, "-") | |
38 | + | let dna = dataArray[2] | |
39 | + | throw(dna) | |
38 | 40 | } | |
39 | 41 | ||
40 | 42 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let JPN = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA' | |
5 | 5 | ||
6 | 6 | let GOLD = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK' | |
7 | 7 | ||
8 | 8 | let BLOCKSTEP = 10 | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func buyUnit (assetID) = { | |
12 | 12 | let cost = match getInteger(this, ("cost_" + assetID)) { | |
13 | 13 | case a: Int => | |
14 | 14 | a | |
15 | 15 | case _ => | |
16 | 16 | 0 | |
17 | 17 | } | |
18 | 18 | let pmt = value(i.payments[0]) | |
19 | 19 | if (isDefined(pmt.assetId)) | |
20 | 20 | then throw("works with waves only") | |
21 | 21 | else if ((pmt.amount != cost)) | |
22 | 22 | then throw("Wrong cost") | |
23 | 23 | else [ScriptTransfer(i.caller, 1, fromBase58String(assetID)), StringEntry(("owner_" + assetID), toBase58String(i.caller.bytes))] | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Callable(i) | |
29 | 29 | func fightWith (samu1) = { | |
30 | 30 | let nftData1 = fromBase58String(samu1) | |
31 | 31 | let x = match assetInfo(nftData1) { | |
32 | 32 | case asset: Asset => | |
33 | 33 | asset.name | |
34 | 34 | case _ => | |
35 | 35 | throw("Can't find asset") | |
36 | 36 | } | |
37 | - | throw(x) | |
37 | + | let dataArray = split(x, "-") | |
38 | + | let dna = dataArray[2] | |
39 | + | throw(dna) | |
38 | 40 | } | |
39 | 41 | ||
40 | 42 | ||
41 | 43 | ||
42 | 44 | @Callable(i) | |
43 | 45 | func goToForest (assetID) = { | |
44 | 46 | let owner = match getString(this, ("owner_" + assetID)) { | |
45 | 47 | case a: String => | |
46 | 48 | a | |
47 | 49 | case _ => | |
48 | 50 | "" | |
49 | 51 | } | |
50 | 52 | let wait = match getInteger(this, ("wait_" + assetID)) { | |
51 | 53 | case a: Int => | |
52 | 54 | a | |
53 | 55 | case _ => | |
54 | 56 | 0 | |
55 | 57 | } | |
56 | 58 | let caller = toBase58String(i.caller.bytes) | |
57 | 59 | let newWait = (lastBlock.height + (BLOCKSTEP * 3)) | |
58 | 60 | let count = ((lastBlock.height % 100) + 1) | |
59 | 61 | if ((caller != owner)) | |
60 | 62 | then throw("You are not owner!") | |
61 | 63 | else if ((wait > lastBlock.height)) | |
62 | 64 | then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking")) | |
63 | 65 | else [ScriptTransfer(i.caller, count, GOLD), IntegerEntry(("wait_" + assetID), newWait)] | |
64 | 66 | } | |
65 | 67 | ||
66 | 68 | ||
67 | 69 | ||
68 | 70 | @Callable(i) | |
69 | 71 | func goToAdventure (assetID) = { | |
70 | 72 | let owner = match getString(this, ("owner_" + assetID)) { | |
71 | 73 | case a: String => | |
72 | 74 | a | |
73 | 75 | case _ => | |
74 | 76 | "" | |
75 | 77 | } | |
76 | 78 | let wait = match getInteger(this, ("wait_" + assetID)) { | |
77 | 79 | case a: Int => | |
78 | 80 | a | |
79 | 81 | case _ => | |
80 | 82 | 0 | |
81 | 83 | } | |
82 | 84 | let caller = toBase58String(i.caller.bytes) | |
83 | 85 | let newWait = (lastBlock.height + BLOCKSTEP) | |
84 | 86 | if ((caller != owner)) | |
85 | 87 | then throw("You are not owner!") | |
86 | 88 | else if ((wait > lastBlock.height)) | |
87 | 89 | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) | |
88 | 90 | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)] | |
89 | 91 | } | |
90 | 92 | ||
91 | 93 |
github/deemru/w8io/169f3d6 40.02 ms ◑