tx · GADQ7j3qvGAxyzVnLkvy99DgkX6UrHwKGm3tutoprxTy 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves 2021.12.08 18:04 [1825435] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{ "type": 13, "id": "GADQ7j3qvGAxyzVnLkvy99DgkX6UrHwKGm3tutoprxTy", "fee": 1000000, "feeAssetId": null, "timestamp": 1638975900529, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "5fGYbS44UiREZAW7Qsco6HrfqDmmak7y7EZmLDv6K7twEX1EmSsQBD77CJFCqLKh58Yot9ifMDxxJwZX62KsdmxU" ], "script": "base64:AAIFAAAAAAAAAA4IAhIDCgEIEgMKAQgSAAAAAAEAAAAABXNlcGFyAgAAAAF8AAAAAwAAAAFpAQAAAAlzdGFydGdhbWUAAAABAAAACmNoYWxsZW5nZXIEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABVtdXN0IHN0YWtlIHNvbWUgd2F2ZXMDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQQAAAAMY2FsbGVyQWRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAACmNvbmRpdGlvbnMJAAS1AAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTgpAAAAAQkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAApjaGFsbGVuZ2VyBQAAAAVzZXBhcgMJAABmAAAAAgkAAZAAAAABB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RjaDAJAAQiAAAAAQkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAAtjaGFsbGVuZGdlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwCQEAAAARQGV4dHJOYXRpdmUoMTA1OCkAAAABCQABLAAAAAICAAAACmNoYWxsZW5nZS0FAAAAC2NoYWxsZW5kZ2VyAgAAAAAEAAAACWNoYWxsZW5nZQkABLUAAAACCQEAAAAMZ2V0Y2hhbGxlbmdlAAAAAQUAAAAMY2FsbGVyQWRyZXNzBQAAAAVzZXBhcgMJAABmAAAAAgkAAZAAAAABBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAADCQAAAAAAAAIJAAGRAAAAAgUAAAAJY2hhbGxlbmdlAAAAAAAAAAAAAgAAAAhhd2FpdGluZwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAACmNoYWxsZW5nZS0FAAAADGNhbGxlckFkcmVzcwkABLkAAAACCQAETAAAAAICAAAABXVuc2V0CQAETAAAAAIJAAGRAAAAAgUAAAAJY2hhbGxlbmdlAAAAAAAAAAABCQAETAAAAAIJAAGRAAAAAgUAAAAJY2hhbGxlbmdlAAAAAAAAAAACBQAAAANuaWwFAAAABXNlcGFyBQAAAANuaWwJAAACAAAAAQIAAAAUY2hhbGxlbmdlIG5vdCBleGlzdHMJAAACAAAAAQIAAAAUY2hhbGxlbmdlIG5vdCBleGlzdHMAAAAATRBnMA==", "height": 1825435, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EeGVH8qh7ygc7TszsafiTXzeGy4i18jutG5zhd9fxQhb Next: 2NhTUvnShbYNEwiBVgKoXmUwSn7j8XUckLfayKdUgZty Diff:
Old | New | Differences | |
---|---|---|---|
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(b) | |
44 | - | func setchallenge (l | |
44 | + | func setchallenge (l) = if (if ((l == "black")) | |
45 | 45 | then true | |
46 | 46 | else (l == "white")) | |
47 | 47 | then { | |
62 | 62 | @Callable(b) | |
63 | 63 | func unsetchallenge () = { | |
64 | 64 | let e = toBase58String(b.caller.bytes) | |
65 | - | func | |
66 | - | let j = getString(("challenge-" + | |
65 | + | func m (n) = { | |
66 | + | let j = getString(("challenge-" + n)) | |
67 | 67 | if ($isInstanceOf(j, "String")) | |
68 | 68 | then { | |
69 | 69 | let k = j | |
70 | - | getStringValue(("challenge-" + | |
70 | + | getStringValue(("challenge-" + n)) | |
71 | 71 | } | |
72 | 72 | else "" | |
73 | 73 | } | |
74 | 74 | ||
75 | - | let | |
76 | - | if ((size( | |
77 | - | then if (( | |
78 | - | then [StringEntry(("challenge-" + e), makeString(["unset", | |
75 | + | let o = split(m(e), a) | |
76 | + | if ((size(o) > 0)) | |
77 | + | then if ((o[0] == "awaiting")) | |
78 | + | then [StringEntry(("challenge-" + e), makeString(["unset", o[1], o[2]], a))] | |
79 | 79 | else throw("challenge not exists") | |
80 | 80 | else throw("challenge not exists") | |
81 | 81 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "|" | |
5 | 5 | ||
6 | 6 | @Callable(b) | |
7 | 7 | func startgame (c) = { | |
8 | 8 | let d = if ((size(b.payments) == 1)) | |
9 | 9 | then b.payments[0] | |
10 | 10 | else throw("must stake some waves") | |
11 | 11 | if (isDefined(d.assetId)) | |
12 | 12 | then throw("works with waves only") | |
13 | 13 | else { | |
14 | 14 | let e = toBase58String(b.caller.bytes) | |
15 | 15 | let f = split(getStringValue(("challenge-" + c)), a) | |
16 | 16 | if ((size(f) > 0)) | |
17 | 17 | then if ((f[0] == "awaiting")) | |
18 | 18 | then { | |
19 | 19 | let g = if ((f[1] == "black")) | |
20 | 20 | then c | |
21 | 21 | else e | |
22 | 22 | let h = if ((f[1] == "white")) | |
23 | 23 | then c | |
24 | 24 | else e | |
25 | 25 | let i = { | |
26 | 26 | let j = getInteger("lastgameid") | |
27 | 27 | if ($isInstanceOf(j, "Int")) | |
28 | 28 | then { | |
29 | 29 | let k = j | |
30 | 30 | getIntegerValue("lastgameid") | |
31 | 31 | } | |
32 | 32 | else 1 | |
33 | 33 | } | |
34 | 34 | $Tuple2([StringEntry(("challenge-" + c), makeString(["awaiting", f[1], f[2], e], a))], [StringEntry(toString(i), makeString(["ongoing", h, g, f[2], "0", "white", "startblock", "laststepblock"], a))]) | |
35 | 35 | } | |
36 | 36 | else throw("no challenge awaiting") | |
37 | 37 | else throw("no challenge") | |
38 | 38 | } | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(b) | |
44 | - | func setchallenge (l | |
44 | + | func setchallenge (l) = if (if ((l == "black")) | |
45 | 45 | then true | |
46 | 46 | else (l == "white")) | |
47 | 47 | then { | |
48 | 48 | let d = if ((size(b.payments) == 1)) | |
49 | 49 | then b.payments[0] | |
50 | 50 | else throw("must stake some waves") | |
51 | 51 | if (isDefined(d.assetId)) | |
52 | 52 | then throw("works with waves only") | |
53 | 53 | else { | |
54 | 54 | let e = toBase58String(b.caller.bytes) | |
55 | 55 | [StringEntry(("challenge-" + e), makeString(["awaiting", l, toString(d.amount)], a))] | |
56 | 56 | } | |
57 | 57 | } | |
58 | 58 | else throw("invalid side") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(b) | |
63 | 63 | func unsetchallenge () = { | |
64 | 64 | let e = toBase58String(b.caller.bytes) | |
65 | - | func | |
66 | - | let j = getString(("challenge-" + | |
65 | + | func m (n) = { | |
66 | + | let j = getString(("challenge-" + n)) | |
67 | 67 | if ($isInstanceOf(j, "String")) | |
68 | 68 | then { | |
69 | 69 | let k = j | |
70 | - | getStringValue(("challenge-" + | |
70 | + | getStringValue(("challenge-" + n)) | |
71 | 71 | } | |
72 | 72 | else "" | |
73 | 73 | } | |
74 | 74 | ||
75 | - | let | |
76 | - | if ((size( | |
77 | - | then if (( | |
78 | - | then [StringEntry(("challenge-" + e), makeString(["unset", | |
75 | + | let o = split(m(e), a) | |
76 | + | if ((size(o) > 0)) | |
77 | + | then if ((o[0] == "awaiting")) | |
78 | + | then [StringEntry(("challenge-" + e), makeString(["unset", o[1], o[2]], a))] | |
79 | 79 | else throw("challenge not exists") | |
80 | 80 | else throw("challenge not exists") | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 |
github/deemru/w8io/026f985 27.11 ms ◑