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