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 | |
---|---|---|---|
40 | 40 | } | |
41 | 41 | else throw("Can't find asset") | |
42 | 42 | } | |
43 | - | throw(l) | |
43 | + | let n = split(l, "-") | |
44 | + | let o = n[2] | |
45 | + | throw(o) | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | ||
47 | 49 | ||
48 | 50 | @Callable(d) | |
49 | 51 | func goToForest (e) = { | |
50 | - | let | |
52 | + | let p = { | |
51 | 53 | let g = getString(this, ("owner_" + e)) | |
52 | 54 | if ($isInstanceOf(g, "String")) | |
53 | 55 | then { | |
56 | 58 | } | |
57 | 59 | else "" | |
58 | 60 | } | |
59 | - | let | |
61 | + | let q = { | |
60 | 62 | let g = getInteger(this, ("wait_" + e)) | |
61 | 63 | if ($isInstanceOf(g, "Int")) | |
62 | 64 | then { | |
65 | 67 | } | |
66 | 68 | else 0 | |
67 | 69 | } | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | if (( | |
70 | + | let r = toBase58String(d.caller.bytes) | |
71 | + | let s = (lastBlock.height + (c * 3)) | |
72 | + | let t = ((lastBlock.height % 100) + 1) | |
73 | + | if ((r != p)) | |
72 | 74 | then throw("You are not owner!") | |
73 | - | else if (( | |
75 | + | else if ((q > lastBlock.height)) | |
74 | 76 | then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking")) | |
75 | - | else [ScriptTransfer(d.caller, | |
77 | + | else [ScriptTransfer(d.caller, t, b), IntegerEntry(("wait_" + e), s)] | |
76 | 78 | } | |
77 | 79 | ||
78 | 80 | ||
79 | 81 | ||
80 | 82 | @Callable(d) | |
81 | 83 | func goToAdventure (e) = { | |
82 | - | let | |
84 | + | let p = { | |
83 | 85 | let g = getString(this, ("owner_" + e)) | |
84 | 86 | if ($isInstanceOf(g, "String")) | |
85 | 87 | then { | |
88 | 90 | } | |
89 | 91 | else "" | |
90 | 92 | } | |
91 | - | let | |
93 | + | let q = { | |
92 | 94 | let g = getInteger(this, ("wait_" + e)) | |
93 | 95 | if ($isInstanceOf(g, "Int")) | |
94 | 96 | then { | |
97 | 99 | } | |
98 | 100 | else 0 | |
99 | 101 | } | |
100 | - | let | |
101 | - | let | |
102 | - | if (( | |
102 | + | let r = toBase58String(d.caller.bytes) | |
103 | + | let s = (lastBlock.height + c) | |
104 | + | if ((r != p)) | |
103 | 105 | then throw("You are not owner!") | |
104 | - | else if (( | |
106 | + | else if ((q > lastBlock.height)) | |
105 | 107 | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) | |
106 | - | else [ScriptTransfer(d.caller, 500000, a), IntegerEntry(("wait_" + e), | |
108 | + | else [ScriptTransfer(d.caller, 500000, a), IntegerEntry(("wait_" + e), s)] | |
107 | 109 | } | |
108 | 110 | ||
109 | 111 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA' | |
5 | 5 | ||
6 | 6 | let b = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK' | |
7 | 7 | ||
8 | 8 | let c = 10 | |
9 | 9 | ||
10 | 10 | @Callable(d) | |
11 | 11 | func buyUnit (e) = { | |
12 | 12 | let f = { | |
13 | 13 | let g = getInteger(this, ("cost_" + e)) | |
14 | 14 | if ($isInstanceOf(g, "Int")) | |
15 | 15 | then { | |
16 | 16 | let h = g | |
17 | 17 | h | |
18 | 18 | } | |
19 | 19 | else 0 | |
20 | 20 | } | |
21 | 21 | let i = value(d.payments[0]) | |
22 | 22 | if (isDefined(i.assetId)) | |
23 | 23 | then throw("works with waves only") | |
24 | 24 | else if ((i.amount != f)) | |
25 | 25 | then throw("Wrong cost") | |
26 | 26 | else [ScriptTransfer(d.caller, 1, fromBase58String(e)), StringEntry(("owner_" + e), toBase58String(d.caller.bytes))] | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(d) | |
32 | 32 | func fightWith (j) = { | |
33 | 33 | let k = fromBase58String(j) | |
34 | 34 | let l = { | |
35 | 35 | let g = assetInfo(k) | |
36 | 36 | if ($isInstanceOf(g, "Asset")) | |
37 | 37 | then { | |
38 | 38 | let m = g | |
39 | 39 | m.name | |
40 | 40 | } | |
41 | 41 | else throw("Can't find asset") | |
42 | 42 | } | |
43 | - | throw(l) | |
43 | + | let n = split(l, "-") | |
44 | + | let o = n[2] | |
45 | + | throw(o) | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | ||
47 | 49 | ||
48 | 50 | @Callable(d) | |
49 | 51 | func goToForest (e) = { | |
50 | - | let | |
52 | + | let p = { | |
51 | 53 | let g = getString(this, ("owner_" + e)) | |
52 | 54 | if ($isInstanceOf(g, "String")) | |
53 | 55 | then { | |
54 | 56 | let h = g | |
55 | 57 | h | |
56 | 58 | } | |
57 | 59 | else "" | |
58 | 60 | } | |
59 | - | let | |
61 | + | let q = { | |
60 | 62 | let g = getInteger(this, ("wait_" + e)) | |
61 | 63 | if ($isInstanceOf(g, "Int")) | |
62 | 64 | then { | |
63 | 65 | let h = g | |
64 | 66 | h | |
65 | 67 | } | |
66 | 68 | else 0 | |
67 | 69 | } | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | if (( | |
70 | + | let r = toBase58String(d.caller.bytes) | |
71 | + | let s = (lastBlock.height + (c * 3)) | |
72 | + | let t = ((lastBlock.height % 100) + 1) | |
73 | + | if ((r != p)) | |
72 | 74 | then throw("You are not owner!") | |
73 | - | else if (( | |
75 | + | else if ((q > lastBlock.height)) | |
74 | 76 | then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking")) | |
75 | - | else [ScriptTransfer(d.caller, | |
77 | + | else [ScriptTransfer(d.caller, t, b), IntegerEntry(("wait_" + e), s)] | |
76 | 78 | } | |
77 | 79 | ||
78 | 80 | ||
79 | 81 | ||
80 | 82 | @Callable(d) | |
81 | 83 | func goToAdventure (e) = { | |
82 | - | let | |
84 | + | let p = { | |
83 | 85 | let g = getString(this, ("owner_" + e)) | |
84 | 86 | if ($isInstanceOf(g, "String")) | |
85 | 87 | then { | |
86 | 88 | let h = g | |
87 | 89 | h | |
88 | 90 | } | |
89 | 91 | else "" | |
90 | 92 | } | |
91 | - | let | |
93 | + | let q = { | |
92 | 94 | let g = getInteger(this, ("wait_" + e)) | |
93 | 95 | if ($isInstanceOf(g, "Int")) | |
94 | 96 | then { | |
95 | 97 | let h = g | |
96 | 98 | h | |
97 | 99 | } | |
98 | 100 | else 0 | |
99 | 101 | } | |
100 | - | let | |
101 | - | let | |
102 | - | if (( | |
102 | + | let r = toBase58String(d.caller.bytes) | |
103 | + | let s = (lastBlock.height + c) | |
104 | + | if ((r != p)) | |
103 | 105 | then throw("You are not owner!") | |
104 | - | else if (( | |
106 | + | else if ((q > lastBlock.height)) | |
105 | 107 | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) | |
106 | - | else [ScriptTransfer(d.caller, 500000, a), IntegerEntry(("wait_" + e), | |
108 | + | else [ScriptTransfer(d.caller, 500000, a), IntegerEntry(("wait_" + e), s)] | |
107 | 109 | } | |
108 | 110 | ||
109 | 111 |
github/deemru/w8io/169f3d6 60.25 ms ◑