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 | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separ = "|" | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func startgame (challenger) = { | |
8 | + | let pmt = if ((size(i.payments) == 1)) | |
9 | + | then i.payments[0] | |
10 | + | else throw("must stake some waves") | |
11 | + | if (isDefined(pmt.assetId)) | |
12 | + | then throw("works with waves only") | |
13 | + | else { | |
14 | + | let callerAdress = toBase58String(i.caller.bytes) | |
15 | + | let conditions = split(getStringValue(("challenge-" + challenger)), separ) | |
16 | + | if ((size(conditions) > 0)) | |
17 | + | then if ((conditions[0] == "awaiting")) | |
18 | + | then { | |
19 | + | let black = if ((conditions[1] == "black")) | |
20 | + | then challenger | |
21 | + | else callerAdress | |
22 | + | let white = if ((conditions[1] == "white")) | |
23 | + | then challenger | |
24 | + | else callerAdress | |
25 | + | let gameid = match getInteger("lastgameid") { | |
26 | + | case a: Int => | |
27 | + | getIntegerValue("lastgameid") | |
28 | + | case _ => | |
29 | + | 1 | |
30 | + | } | |
31 | + | $Tuple2([StringEntry(("challenge-" + challenger), makeString(["awaiting", conditions[1], conditions[2], callerAdress], separ))], [StringEntry(toString(gameid), makeString(["ongoing", white, black, conditions[2], "0", "white", "startblock", "laststepblock"], separ))]) | |
32 | + | } | |
33 | + | else throw("no challenge awaiting") | |
34 | + | else throw("no challenge") | |
35 | + | } | |
36 | + | } | |
37 | + | ||
38 | + | ||
5 | 39 | ||
6 | 40 | @Callable(i) | |
7 | 41 | func setchallenge (side,stake) = if (if ((side == "black")) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separ = "|" | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func startgame (challenger) = { | |
8 | + | let pmt = if ((size(i.payments) == 1)) | |
9 | + | then i.payments[0] | |
10 | + | else throw("must stake some waves") | |
11 | + | if (isDefined(pmt.assetId)) | |
12 | + | then throw("works with waves only") | |
13 | + | else { | |
14 | + | let callerAdress = toBase58String(i.caller.bytes) | |
15 | + | let conditions = split(getStringValue(("challenge-" + challenger)), separ) | |
16 | + | if ((size(conditions) > 0)) | |
17 | + | then if ((conditions[0] == "awaiting")) | |
18 | + | then { | |
19 | + | let black = if ((conditions[1] == "black")) | |
20 | + | then challenger | |
21 | + | else callerAdress | |
22 | + | let white = if ((conditions[1] == "white")) | |
23 | + | then challenger | |
24 | + | else callerAdress | |
25 | + | let gameid = match getInteger("lastgameid") { | |
26 | + | case a: Int => | |
27 | + | getIntegerValue("lastgameid") | |
28 | + | case _ => | |
29 | + | 1 | |
30 | + | } | |
31 | + | $Tuple2([StringEntry(("challenge-" + challenger), makeString(["awaiting", conditions[1], conditions[2], callerAdress], separ))], [StringEntry(toString(gameid), makeString(["ongoing", white, black, conditions[2], "0", "white", "startblock", "laststepblock"], separ))]) | |
32 | + | } | |
33 | + | else throw("no challenge awaiting") | |
34 | + | else throw("no challenge") | |
35 | + | } | |
36 | + | } | |
37 | + | ||
38 | + | ||
5 | 39 | ||
6 | 40 | @Callable(i) | |
7 | 41 | func setchallenge (side,stake) = if (if ((side == "black")) | |
8 | 42 | then true | |
9 | 43 | else (side == "white")) | |
10 | 44 | then { | |
11 | 45 | let pmt = if ((size(i.payments) == 1)) | |
12 | 46 | then i.payments[0] | |
13 | 47 | else throw("must stake some waves") | |
14 | 48 | if (isDefined(pmt.assetId)) | |
15 | 49 | then throw("works with waves only") | |
16 | 50 | else { | |
17 | 51 | let callerAdress = toBase58String(i.caller.bytes) | |
18 | 52 | [StringEntry(("challenge-" + callerAdress), makeString(["awaiting", side, toString(pmt.amount)], separ))] | |
19 | 53 | } | |
20 | 54 | } | |
21 | 55 | else throw("invalid side") | |
22 | 56 | ||
23 | 57 | ||
24 | 58 | ||
25 | 59 | @Callable(i) | |
26 | 60 | func unsetchallenge () = { | |
27 | 61 | let callerAdress = toBase58String(i.caller.bytes) | |
28 | 62 | func getchallenge (challendger) = match getString(("challenge-" + challendger)) { | |
29 | 63 | case a: String => | |
30 | 64 | getStringValue(("challenge-" + challendger)) | |
31 | 65 | case _ => | |
32 | 66 | "" | |
33 | 67 | } | |
34 | 68 | ||
35 | 69 | let challenge = split(getchallenge(callerAdress), separ) | |
36 | 70 | if ((size(challenge) > 0)) | |
37 | 71 | then if ((challenge[0] == "awaiting")) | |
38 | 72 | then [StringEntry(("challenge-" + callerAdress), makeString(["unset", challenge[1], challenge[2]], separ))] | |
39 | 73 | else throw("challenge not exists") | |
40 | 74 | else throw("challenge not exists") | |
41 | 75 | } | |
42 | 76 | ||
43 | 77 |
github/deemru/w8io/026f985 22.85 ms ◑