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
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 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+
539
640 @Callable(i)
741 func setchallenge (side,stake) = if (if ((side == "black"))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 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+
539
640 @Callable(i)
741 func setchallenge (side,stake) = if (if ((side == "black"))
842 then true
943 else (side == "white"))
1044 then {
1145 let pmt = if ((size(i.payments) == 1))
1246 then i.payments[0]
1347 else throw("must stake some waves")
1448 if (isDefined(pmt.assetId))
1549 then throw("works with waves only")
1650 else {
1751 let callerAdress = toBase58String(i.caller.bytes)
1852 [StringEntry(("challenge-" + callerAdress), makeString(["awaiting", side, toString(pmt.amount)], separ))]
1953 }
2054 }
2155 else throw("invalid side")
2256
2357
2458
2559 @Callable(i)
2660 func unsetchallenge () = {
2761 let callerAdress = toBase58String(i.caller.bytes)
2862 func getchallenge (challendger) = match getString(("challenge-" + challendger)) {
2963 case a: String =>
3064 getStringValue(("challenge-" + challendger))
3165 case _ =>
3266 ""
3367 }
3468
3569 let challenge = split(getchallenge(callerAdress), separ)
3670 if ((size(challenge) > 0))
3771 then if ((challenge[0] == "awaiting"))
3872 then [StringEntry(("challenge-" + callerAdress), makeString(["unset", challenge[1], challenge[2]], separ))]
3973 else throw("challenge not exists")
4074 else throw("challenge not exists")
4175 }
4276
4377

github/deemru/w8io/026f985 
22.85 ms