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:AAIFAAAAAAAAAA8IAhIDCgEIEgQKAggBEgAAAAABAAAAAAVzZXBhcgIAAAABfAAAAAMAAAABaQEAAAAJc3RhcnRnYW1lAAAAAQAAAApjaGFsbGVuZ2VyBAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAVbXVzdCBzdGFrZSBzb21lIHdhdmVzAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAABV3b3JrcyB3aXRoIHdhdmVzIG9ubHkEAAAADGNhbGxlckFkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAApjb25kaXRpb25zCQAEtQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDU4KQAAAAEJAAEsAAAAAgIAAAAKY2hhbGxlbmdlLQUAAAAKY2hhbGxlbmdlcgUAAAAFc2VwYXIDCQAAZgAAAAIJAAG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bGVuZ2UAAAABAAAAC2NoYWxsZW5kZ2VyBAAAAAckbWF0Y2gwCQAEIgAAAAEJAAEsAAAAAgIAAAAKY2hhbGxlbmdlLQUAAAALY2hhbGxlbmRnZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAkBAAAAEUBleHRyTmF0aXZlKDEwNTgpAAAAAQkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAAtjaGFsbGVuZGdlcgIAAAAABAAAAAljaGFsbGVuZ2UJAAS1AAAAAgkBAAAADGdldGNoYWxsZW5nZQAAAAEFAAAADGNhbGxlckFkcmVzcwUAAAAFc2VwYXIDCQAAZgAAAAIJAAGQAAAAAQUAAAAJY2hhbGxlbmdlAAAAAAAAAAAAAwkAAAAAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAAIAAAAIYXdhaXRpbmcJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAAxjYWxsZXJBZHJlc3MJAAS5AAAAAgkABEwAAAACAgAAAAV1bnNldAkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAQkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAgUAAAADbmlsBQAAAAVzZXBhcgUAAAADbmlsCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzAAAAAPUcUak=", "height": 1825430, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FgdxQLhK9hLNCCsR7HWMxXX4wQiDwEUL79HygmyGvWFT Next: GADQ7j3qvGAxyzVnLkvy99DgkX6UrHwKGm3tutoprxTy Diff:
OldNewDifferences
44 let a = "|"
55
66 @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"))
845 then true
9- else (c == "white"))
46+ else (l == "white"))
1047 then {
11- let e = if ((size(b.payments) == 1))
48+ let d = if ((size(b.payments) == 1))
1249 then b.payments[0]
1350 else throw("must stake some waves")
14- if (isDefined(e.assetId))
51+ if (isDefined(d.assetId))
1552 then throw("works with waves only")
1653 else {
17- let f = toBase58String(b.caller.bytes)
18-[StringEntry(("challenge-" + f), makeString(["awaiting", c, toString(e.amount)], a))]
54+ let e = toBase58String(b.caller.bytes)
55+[StringEntry(("challenge-" + e), makeString(["awaiting", l, toString(d.amount)], a))]
1956 }
2057 }
2158 else throw("invalid side")
2461
2562 @Callable(b)
2663 func unsetchallenge () = {
27- let f = toBase58String(b.caller.bytes)
28- func g (h) = {
29- let i = getString(("challenge-" + h))
30- if ($isInstanceOf(i, "String"))
64+ let e = toBase58String(b.caller.bytes)
65+ func n (o) = {
66+ let j = getString(("challenge-" + o))
67+ if ($isInstanceOf(j, "String"))
3168 then {
32- let j = i
33- getStringValue(("challenge-" + h))
69+ let k = j
70+ getStringValue(("challenge-" + o))
3471 }
3572 else ""
3673 }
3774
38- let k = split(g(f), a)
39- if ((size(k) > 0))
40- then if ((k[0] == "awaiting"))
41- then [StringEntry(("challenge-" + f), makeString(["unset", k[1], k[2]], a))]
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))]
4279 else throw("challenge not exists")
4380 else throw("challenge not exists")
4481 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "|"
55
66 @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"))
845 then true
9- else (c == "white"))
46+ else (l == "white"))
1047 then {
11- let e = if ((size(b.payments) == 1))
48+ let d = if ((size(b.payments) == 1))
1249 then b.payments[0]
1350 else throw("must stake some waves")
14- if (isDefined(e.assetId))
51+ if (isDefined(d.assetId))
1552 then throw("works with waves only")
1653 else {
17- let f = toBase58String(b.caller.bytes)
18-[StringEntry(("challenge-" + f), makeString(["awaiting", c, toString(e.amount)], a))]
54+ let e = toBase58String(b.caller.bytes)
55+[StringEntry(("challenge-" + e), makeString(["awaiting", l, toString(d.amount)], a))]
1956 }
2057 }
2158 else throw("invalid side")
2259
2360
2461
2562 @Callable(b)
2663 func unsetchallenge () = {
27- let f = toBase58String(b.caller.bytes)
28- func g (h) = {
29- let i = getString(("challenge-" + h))
30- if ($isInstanceOf(i, "String"))
64+ let e = toBase58String(b.caller.bytes)
65+ func n (o) = {
66+ let j = getString(("challenge-" + o))
67+ if ($isInstanceOf(j, "String"))
3168 then {
32- let j = i
33- getStringValue(("challenge-" + h))
69+ let k = j
70+ getStringValue(("challenge-" + o))
3471 }
3572 else ""
3673 }
3774
38- let k = split(g(f), a)
39- if ((size(k) > 0))
40- then if ((k[0] == "awaiting"))
41- then [StringEntry(("challenge-" + f), makeString(["unset", k[1], k[2]], a))]
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))]
4279 else throw("challenge not exists")
4380 else throw("challenge not exists")
4481 }
4582
4683

github/deemru/w8io/026f985 
28.96 ms