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:AAIFAAAAAAAAAA4IAhIDCgEIEgMKAQgSAAAAAAEAAAAABXNlcGFyAgAAAAF8AAAAAwAAAAFpAQAAAAlzdGFydGdhbWUAAAABAAAACmNoYWxsZW5nZXIEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABVtdXN0IHN0YWtlIHNvbWUgd2F2ZXMDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQQAAAAMY2FsbGVyQWRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAACmNvbmRpdGlvbnMJAAS1AAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTgpAAAAAQkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAApjaGFsbGVuZ2VyBQAAAAVzZXBhcgMJAABmAAAAAgkAAZAAAAAB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XRjaDAJAAQiAAAAAQkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAAtjaGFsbGVuZGdlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwCQEAAAARQGV4dHJOYXRpdmUoMTA1OCkAAAABCQABLAAAAAICAAAACmNoYWxsZW5nZS0FAAAAC2NoYWxsZW5kZ2VyAgAAAAAEAAAACWNoYWxsZW5nZQkABLUAAAACCQEAAAAMZ2V0Y2hhbGxlbmdlAAAAAQUAAAAMY2FsbGVyQWRyZXNzBQAAAAVzZXBhcgMJAABmAAAAAgkAAZAAAAABBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAADCQAAAAAAAAIJAAGRAAAAAgUAAAAJY2hhbGxlbmdlAAAAAAAAAAAAAgAAAAhhd2FpdGluZwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAACmNoYWxsZW5nZS0FAAAADGNhbGxlckFkcmVzcwkABLkAAAACCQAETAAAAAICAAAABXVuc2V0CQAETAAAAAIJAAGRAAAAAgUAAAAJY2hhbGxlbmdlAAAAAAAAAAABCQAETAAAAAIJAAGRAAAAAgUAAAAJY2hhbGxlbmdlAAAAAAAAAAACBQAAAANuaWwFAAAABXNlcGFyBQAAAANuaWwJAAACAAAAAQIAAAAUY2hhbGxlbmdlIG5vdCBleGlzdHMJAAACAAAAAQIAAAAUY2hhbGxlbmdlIG5vdCBleGlzdHMAAAAATRBnMA==", "height": 1825435, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EeGVH8qh7ygc7TszsafiTXzeGy4i18jutG5zhd9fxQhb Next: 2NhTUvnShbYNEwiBVgKoXmUwSn7j8XUckLfayKdUgZty Diff:
OldNewDifferences
3838
3939
4040 @Callable(i)
41-func setchallenge (side,stake) = if (if ((side == "black"))
41+func setchallenge (side) = if (if ((side == "black"))
4242 then true
4343 else (side == "white"))
4444 then {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separ = "|"
55
66 @Callable(i)
77 func startgame (challenger) = {
88 let pmt = if ((size(i.payments) == 1))
99 then i.payments[0]
1010 else throw("must stake some waves")
1111 if (isDefined(pmt.assetId))
1212 then throw("works with waves only")
1313 else {
1414 let callerAdress = toBase58String(i.caller.bytes)
1515 let conditions = split(getStringValue(("challenge-" + challenger)), separ)
1616 if ((size(conditions) > 0))
1717 then if ((conditions[0] == "awaiting"))
1818 then {
1919 let black = if ((conditions[1] == "black"))
2020 then challenger
2121 else callerAdress
2222 let white = if ((conditions[1] == "white"))
2323 then challenger
2424 else callerAdress
2525 let gameid = match getInteger("lastgameid") {
2626 case a: Int =>
2727 getIntegerValue("lastgameid")
2828 case _ =>
2929 1
3030 }
3131 $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))])
3232 }
3333 else throw("no challenge awaiting")
3434 else throw("no challenge")
3535 }
3636 }
3737
3838
3939
4040 @Callable(i)
41-func setchallenge (side,stake) = if (if ((side == "black"))
41+func setchallenge (side) = if (if ((side == "black"))
4242 then true
4343 else (side == "white"))
4444 then {
4545 let pmt = if ((size(i.payments) == 1))
4646 then i.payments[0]
4747 else throw("must stake some waves")
4848 if (isDefined(pmt.assetId))
4949 then throw("works with waves only")
5050 else {
5151 let callerAdress = toBase58String(i.caller.bytes)
5252 [StringEntry(("challenge-" + callerAdress), makeString(["awaiting", side, toString(pmt.amount)], separ))]
5353 }
5454 }
5555 else throw("invalid side")
5656
5757
5858
5959 @Callable(i)
6060 func unsetchallenge () = {
6161 let callerAdress = toBase58String(i.caller.bytes)
6262 func getchallenge (challendger) = match getString(("challenge-" + challendger)) {
6363 case a: String =>
6464 getStringValue(("challenge-" + challendger))
6565 case _ =>
6666 ""
6767 }
6868
6969 let challenge = split(getchallenge(callerAdress), separ)
7070 if ((size(challenge) > 0))
7171 then if ((challenge[0] == "awaiting"))
7272 then [StringEntry(("challenge-" + callerAdress), makeString(["unset", challenge[1], challenge[2]], separ))]
7373 else throw("challenge not exists")
7474 else throw("challenge not exists")
7575 }
7676
7777

github/deemru/w8io/026f985 
30.75 ms