tx · 25WvUy1u3nNvmdtSEsLmqGQbgeBMi14Lc6PKtwihd7ra

3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV:  -0.01000000 Waves

2021.12.09 11:27 [1826461] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves

{ "type": 13, "id": "25WvUy1u3nNvmdtSEsLmqGQbgeBMi14Lc6PKtwihd7ra", "fee": 1000000, "feeAssetId": null, "timestamp": 1639038478990, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "2TA1jGBC9SSnNxLNyV7roZ1fWujx7J5bjdxQBodCqSsKpqjug7wnmJi76qYTZnWbXpH1PYWzTaEaSVVBXoUruVzX" ], "script": "base64:AAIFAAAAAAAAABwIAhIAEgASBQoDCAgIEgMKAQgSAwoBCBIDCgEIAAAAAQAAAAAFc2VwYXICAAAAAXwAAAAGAAAAAWkBAAAABXJlc2V0AAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAApsYXN0Z2FtZWlkAgAAAAEwCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAD2xhc3RjaGFsbGVuZ2VpZAIAAAABMAUAAAADbmlsAAAAAWkBAAAACHNldHJ1bGVzAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtYmYrAgAAAAotMSwtMXwxLC0xCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG1iZi0CAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtd2YrAgAAAAgtMSwxfDEsMQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtd2YtAgAAAAAFAAAAA25pbAAAAAFpAQAAAARtb3ZlAAAAAwAAAAZnYW1laWQAAAAEZnJvbQAAAA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bmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAKY2hhbGxlbmdlLQUAAAAMY2hhbGxlbmRnZWlkCQAEuQAAAAIJAARMAAAAAgIAAAAFdW5zZXQJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAEJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAIJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAMFAAAAA25pbAUAAAAFc2VwYXIFAAAAA25pbAkAAAIAAAABAgAAABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwkAAAIAAAABAgAAABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwAAAADAFgkh", "height": 1826461, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8y2C3N3BzQKupBcKKues5evvGR3kara3EbGrfG9wPDHW Next: GZMrG7JyroYqqGmd9FjGxe9S8JVQQzSqJHRAXCeKw5Us Diff:
OldNewDifferences
99
1010
1111 @Callable(i)
12-func setrules () = [StringEntry("mb+", "-1,-1|1,-1"), StringEntry("mb-", ""), StringEntry("mw+", "-1,1|1,1"), StringEntry("mb-", "")]
12+func setrules () = [StringEntry("mbf+", "-1,-1|1,-1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,1|1,1"), StringEntry("mwf-", "")]
1313
1414
1515
6060 then "e"
6161 else throw("can not eat himself")
6262 let movement = ((toString((fromx - tox)) + ",") + toString((fromy - toy)))
63- let possible = split(getStringValue((movetype + figure)), "|")
63+ let possible = split(getStringValue(((movetype + side) + figure)), "|")
6464 let iscorrect = if (containsElement(possible, movement))
6565 then true
6666 else throw("incorrect movement")
6767 if (iscorrect)
68- then [StringEntry("_", "figure")]
68+ then [StringEntry("_", "possible")]
6969 else [StringEntry("_", "_")]
7070 }
7171 else throw("Strict value is not equal to itself.")
105105 else callerAdress
106106 let gameid = toString((parseIntValue(getStringValue("lastgameid")) + 1))
107107 [StringEntry(("challenge-" + challengeid), makeString([gameid, conditions[1], conditions[2], conditions[3], callerAdress], separ)), {
108- let situation = "wl-wh-we-wf-wq-we-wh-wl!wp-wp-wp-wp-wp-wp-wp-wp!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!bp-bp-bp-bp-bp-bp-bp-bp!bl-bh-be-bf-bq-be-bh-bl"
108+ let situation = "wf-00-wf-00-wf-00-wf-00!00-wf-00-wf-00-wf-00-wf!wf-00-wf-00-wf-00-wf-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-bf-00-bf-00-bf-00-bf!bf-00-bf-00-bf-00-bf-00!00-bf-00-bf-00-bf-00-bf"
109109 StringEntry(("game-" + gameid), makeString(["ongoing", white, black, conditions[3], "0", "w", "startblock", "laststepblock", situation], separ))
110110 }, StringEntry("lastgameid", gameid), ScriptTransfer(i.caller, (pmt.amount - parseIntValue(conditions[3])), unit)]
111111 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separ = "|"
55
66 @Callable(i)
77 func reset () = [StringEntry("lastgameid", "0"), StringEntry("lastchallengeid", "0")]
88
99
1010
1111 @Callable(i)
12-func setrules () = [StringEntry("mb+", "-1,-1|1,-1"), StringEntry("mb-", ""), StringEntry("mw+", "-1,1|1,1"), StringEntry("mb-", "")]
12+func setrules () = [StringEntry("mbf+", "-1,-1|1,-1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,1|1,1"), StringEntry("mwf-", "")]
1313
1414
1515
1616 @Callable(i)
1717 func move (gameid,from,to) = {
1818 let game = split(getStringValue(("game-" + gameid)), separ)
1919 if ((game == game))
2020 then {
2121 let callerAdress = toBase58String(i.caller.bytes)
2222 if ((callerAdress == callerAdress))
2323 then {
2424 let isgame = if ((game[0] == "ongoing"))
2525 then true
2626 else throw("not ongoing game")
2727 if ((isgame == isgame))
2828 then {
2929 let side = if (if (isgame)
3030 then if ((game[1] == callerAdress))
3131 then true
3232 else (game[2] == callerAdress)
3333 else false)
3434 then if ((game[1] == callerAdress))
3535 then "w"
3636 else "b"
3737 else throw("not gamer")
3838 if ((side == side))
3939 then {
4040 let otherside = if ((side == "w"))
4141 then "b"
4242 else "w"
4343 let turn = if ((side == game[5]))
4444 then true
4545 else throw("not your turn")
4646 if ((turn == turn))
4747 then {
4848 let situation = split(game[8], "!")
4949 let cells = [split(situation[0], "-"), split(situation[1], "|"), split(situation[2], "|"), split(situation[3], "|"), split(situation[4], "|"), split(situation[5], "|"), split(situation[6], "|"), split(situation[7], "|")]
5050 if ((cells == cells))
5151 then {
5252 let fromx = parseIntValue(take(from, 1))
5353 let fromy = parseIntValue(takeRight(from, 1))
5454 let tox = parseIntValue(take(to, 1))
5555 let toy = parseIntValue(takeRight(to, 1))
5656 let figure = takeRight(cells[fromx][fromy], 1)
5757 let movetype = if ((take(cells[tox][toy], 1) == "0"))
5858 then "m"
5959 else if ((take(cells[tox][toy], 1) == otherside))
6060 then "e"
6161 else throw("can not eat himself")
6262 let movement = ((toString((fromx - tox)) + ",") + toString((fromy - toy)))
63- let possible = split(getStringValue((movetype + figure)), "|")
63+ let possible = split(getStringValue(((movetype + side) + figure)), "|")
6464 let iscorrect = if (containsElement(possible, movement))
6565 then true
6666 else throw("incorrect movement")
6767 if (iscorrect)
68- then [StringEntry("_", "figure")]
68+ then [StringEntry("_", "possible")]
6969 else [StringEntry("_", "_")]
7070 }
7171 else throw("Strict value is not equal to itself.")
7272 }
7373 else throw("Strict value is not equal to itself.")
7474 }
7575 else throw("Strict value is not equal to itself.")
7676 }
7777 else throw("Strict value is not equal to itself.")
7878 }
7979 else throw("Strict value is not equal to itself.")
8080 }
8181 else throw("Strict value is not equal to itself.")
8282 }
8383
8484
8585
8686 @Callable(i)
8787 func startgame (challengeid) = {
8888 let pmt = if ((size(i.payments) == 1))
8989 then i.payments[0]
9090 else throw("must stake some waves")
9191 if (isDefined(pmt.assetId))
9292 then throw("works with waves only")
9393 else {
9494 let callerAdress = toBase58String(i.caller.bytes)
9595 let conditions = split(getStringValue(("challenge-" + challengeid)), separ)
9696 if ((size(conditions) > 0))
9797 then if ((pmt.amount >= parseIntValue(conditions[3])))
9898 then if ((conditions[0] == "awaiting"))
9999 then {
100100 let black = if ((conditions[2] == "b"))
101101 then conditions[1]
102102 else callerAdress
103103 let white = if ((conditions[2] == "w"))
104104 then conditions[1]
105105 else callerAdress
106106 let gameid = toString((parseIntValue(getStringValue("lastgameid")) + 1))
107107 [StringEntry(("challenge-" + challengeid), makeString([gameid, conditions[1], conditions[2], conditions[3], callerAdress], separ)), {
108- let situation = "wl-wh-we-wf-wq-we-wh-wl!wp-wp-wp-wp-wp-wp-wp-wp!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!bp-bp-bp-bp-bp-bp-bp-bp!bl-bh-be-bf-bq-be-bh-bl"
108+ let situation = "wf-00-wf-00-wf-00-wf-00!00-wf-00-wf-00-wf-00-wf!wf-00-wf-00-wf-00-wf-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-bf-00-bf-00-bf-00-bf!bf-00-bf-00-bf-00-bf-00!00-bf-00-bf-00-bf-00-bf"
109109 StringEntry(("game-" + gameid), makeString(["ongoing", white, black, conditions[3], "0", "w", "startblock", "laststepblock", situation], separ))
110110 }, StringEntry("lastgameid", gameid), ScriptTransfer(i.caller, (pmt.amount - parseIntValue(conditions[3])), unit)]
111111 }
112112 else throw("no challenge awaiting")
113113 else throw("need more money")
114114 else throw("no challenge")
115115 }
116116 }
117117
118118
119119
120120 @Callable(i)
121121 func setchallenge (side) = if (if ((side == "b"))
122122 then true
123123 else (side == "w"))
124124 then {
125125 let pmt = if ((size(i.payments) == 1))
126126 then i.payments[0]
127127 else throw("must stake some waves")
128128 if (isDefined(pmt.assetId))
129129 then throw("works with waves only")
130130 else {
131131 let callerAdress = toBase58String(i.caller.bytes)
132132 let challengeid = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
133133 [StringEntry(("challenge-" + challengeid), makeString(["awaiting", callerAdress, side, toString(pmt.amount)], separ)), StringEntry("lastchallengeid", challengeid)]
134134 }
135135 }
136136 else throw("invalid side")
137137
138138
139139
140140 @Callable(i)
141141 func unsetchallenge (challendgeid) = {
142142 let callerAdress = toBase58String(i.caller.bytes)
143143 func getchallenge (challendgeid) = match getString(("challenge-" + challendgeid)) {
144144 case a: String =>
145145 getStringValue(("challenge-" + challendgeid))
146146 case _ =>
147147 ""
148148 }
149149
150150 let challenge = split(getchallenge(challendgeid), separ)
151151 if ((size(challenge) > 0))
152152 then if ((challenge[0] == "awaiting"))
153153 then [StringEntry(("challenge-" + challendgeid), makeString(["unset", challenge[1], challenge[2], challenge[3]], separ))]
154154 else throw("challenge not exists")
155155 else throw("challenge not exists")
156156 }
157157
158158

github/deemru/w8io/026f985 
35.55 ms