tx · 2SztSpmrroE8FtDBuHwghwZjwaQ21AM6GiVb1Qx7BNWr 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6: -0.01000000 Waves 2021.07.01 20:49 [1594866] smart account 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6 > SELF 0.00000000 Waves
{ "type": 13, "id": "2SztSpmrroE8FtDBuHwghwZjwaQ21AM6GiVb1Qx7BNWr", "fee": 1000000, "feeAssetId": null, "timestamp": 1625161798877, "version": 2, "chainId": 84, "sender": "3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6", "senderPublicKey": "4f5Wt4MDH3Qt6DMuZQid3zoj463xCUkNdUWjUcChuedh", "proofs": [ "3BDcakxgRPYZxCc9arDfjes5AmgGdUByjUc5ds5x7e4yStTyjLPa8xeXV2YjShjjLWR41izYWirSceRGpiGUx5RY" ], "script": "base64:AAIFAAAAAAAAABYIAhIDCgEIEgMKAQgSAwoBCBIDCgEIAAAAAwAAAAADSlBOAQAAACBFqLGvjcwUgk68Uea/woMfyoMncahjkWcixg2ZF+iMxQAAAAAER09MRAEAAAAgLR44CaQZZUypJtV0fmMzG/7TvBdMmwMi7yR7k3IM0LwAAAAACUJMT0NLU1RFUAAAAAAAAAAACgAAAAQAAAABaQEAAAAHYnV5VW5pdAAAAAEAAAAHYXNzZXRJRAQAAAAEY29zdAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAABWNvc3RfBQAAAAdhc3NldElEAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5AwkBAAAAAiE9AAA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AR0aGlzCQABLAAAAAICAAAABXdhaXRfBQAAAAdhc3NldElEAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAABmNhbGxlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAduZXdXYWl0CQAAZAAAAAIIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0BQAAAAlCTE9DS1NURVADCQEAAAACIT0AAAACBQAAAAZjYWxsZXIFAAAABW93bmVyCQAAAgAAAAECAAAAEllvdSBhcmUgbm90IG93bmVyIQMJAABmAAAAAgUAAAAEd2FpdAgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAAACAAAAAQkAASwAAAACCQABLAAAAAICAAAAEVN0aWxsIHdhaXQgYmxvY2sgCQABpAAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AgAAABIgZm9yIG5ldyBhZHZlbnR1cmUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAB6EgBQAAAANKUE4JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFd2FpdF8FAAAAB2Fzc2V0SUQFAAAAB25ld1dhaXQFAAAAA25pbAAAAACq28ys", "height": 1594866, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HESPyhCPjpF34ttbvtQM6wsrG39iXq3AQfbu18sqP9Q2 Next: Ac5aFDu5yyrg76VpYnPd9vj3JNVm6zbNqcAXnj8J8sUW Diff:
Old | New | Differences | |
---|---|---|---|
36 | 36 | } | |
37 | 37 | let dataArray = split(x, "-") | |
38 | 38 | let dna = dataArray[2] | |
39 | - | let atk = toInt(fromBase16String( | |
39 | + | let atk = toInt(fromBase16String("AB")) | |
40 | 40 | throw(toString(atk)) | |
41 | 41 | } | |
42 | 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 | 37 | let dataArray = split(x, "-") | |
38 | 38 | let dna = dataArray[2] | |
39 | - | let atk = toInt(fromBase16String( | |
39 | + | let atk = toInt(fromBase16String("AB")) | |
40 | 40 | throw(toString(atk)) | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(i) | |
46 | 46 | func goToForest (assetID) = { | |
47 | 47 | let owner = match getString(this, ("owner_" + assetID)) { | |
48 | 48 | case a: String => | |
49 | 49 | a | |
50 | 50 | case _ => | |
51 | 51 | "" | |
52 | 52 | } | |
53 | 53 | let wait = match getInteger(this, ("wait_" + assetID)) { | |
54 | 54 | case a: Int => | |
55 | 55 | a | |
56 | 56 | case _ => | |
57 | 57 | 0 | |
58 | 58 | } | |
59 | 59 | let caller = toBase58String(i.caller.bytes) | |
60 | 60 | let newWait = (lastBlock.height + (BLOCKSTEP * 3)) | |
61 | 61 | let count = ((lastBlock.height % 100) + 1) | |
62 | 62 | if ((caller != owner)) | |
63 | 63 | then throw("You are not owner!") | |
64 | 64 | else if ((wait > lastBlock.height)) | |
65 | 65 | then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking")) | |
66 | 66 | else [ScriptTransfer(i.caller, count, GOLD), IntegerEntry(("wait_" + assetID), newWait)] | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | ||
71 | 71 | @Callable(i) | |
72 | 72 | func goToAdventure (assetID) = { | |
73 | 73 | let owner = match getString(this, ("owner_" + assetID)) { | |
74 | 74 | case a: String => | |
75 | 75 | a | |
76 | 76 | case _ => | |
77 | 77 | "" | |
78 | 78 | } | |
79 | 79 | let wait = match getInteger(this, ("wait_" + assetID)) { | |
80 | 80 | case a: Int => | |
81 | 81 | a | |
82 | 82 | case _ => | |
83 | 83 | 0 | |
84 | 84 | } | |
85 | 85 | let caller = toBase58String(i.caller.bytes) | |
86 | 86 | let newWait = (lastBlock.height + BLOCKSTEP) | |
87 | 87 | if ((caller != owner)) | |
88 | 88 | then throw("You are not owner!") | |
89 | 89 | else if ((wait > lastBlock.height)) | |
90 | 90 | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) | |
91 | 91 | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)] | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 |
github/deemru/w8io/169f3d6 26.59 ms ◑