tx · 61q2JQ1FDnGsgv6LaJVmhC2zLbs16BvisjTij3cTtnGA

3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV:  -0.01000000 Waves

2021.12.08 21:32 [1825636] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves

{ "type": 13, "id": "61q2JQ1FDnGsgv6LaJVmhC2zLbs16BvisjTij3cTtnGA", "fee": 1000000, "feeAssetId": null, "timestamp": 1638988377435, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "22Vw8hots2pDSgWvNx1jNT7N4uqw4efrF3Hh5oxCCYxd1h6Y887PGasTHyjsdhdhsdoc7SFK5rVwZwvtBmajm2ZB" ], "script": "base64:AAIFAAAAAAAAABoIAhIAEgUKAwgICBIDCgEIEgMKAQgSAwoBCAAAAAEAAAAABXNlcGFyAgAAAAF8AAAABQAAAAFpAQAAAAVyZXNldAAAAAAJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAKbGFzdGdhbWVpZAIAAAABMAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAA9sYXN0Y2hhbGxlbmdlaWQCAAAAATAFAAAAA25pbAAAAAFpAQAAAAVtb292ZQAAAAMAAAAGZ2FtZWlkAAAABGZyb20AAAACdG8EAAAABGdhbWUJAAS1AAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTgpAAAAAQkAASwAAAACAgAAAAVnYW1lLQUAAAAGZ2FtZWlkBQAAAAVzZXBhcgMJAAAAAAAAAgkAAZEAAAACBQAAAARnYW1lAAAAAAAAAAAAAgAAAAdvbmdvaW5nBAAAAAxjYWxsZXJBZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwMDCQAAAAAAAAIJAAGRAAAAAgUAAAAEZ2Ft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ABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwkAAAIAAAABAgAAABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwAAAACUM3/H", "height": 1825636, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Cz1nVhJ7CuEHYvMiAwa7yGLbPqyUHYtcFgmR9wShtjX Next: 4QxjvxHg76BRbog9kQer2hUfmQuaeF7hPWjy7ozWYGLA Diff:
OldNewDifferences
6565 else [StringEntry("-", "-")]
6666 else [StringEntry("-", "-")]
6767 }
68- else throw("not siotuation")
68+ else throw("not situation")
6969 }
7070 else throw("not your turn")
7171 }
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)
1212 func moove (gameid,from,to) = {
1313 let game = split(getStringValue(("game-" + gameid)), separ)
1414 if ((game[0] == "ongoing"))
1515 then {
1616 let callerAdress = toBase58String(i.caller.bytes)
1717 if (if ((game[1] == callerAdress))
1818 then true
1919 else (game[2] == callerAdress))
2020 then {
2121 let side = if ((game[1] == callerAdress))
2222 then "w"
2323 else "b"
2424 if ((game[5] == side))
2525 then {
2626 let situation = game[8]
2727 let tolist = split(to, "")
2828 if (if (contains(situation, from))
2929 then (tolist[3] != side)
3030 else false)
3131 then {
3232 let fromlist = split(from, "")
3333 let figure = fromlist[5]
3434 let fromx = parseIntValue(fromlist[0])
3535 let fromy = parseIntValue(fromlist[1])
3636 let tox = parseIntValue(tolist[0])
3737 let toy = parseIntValue(tolist[1])
3838 let rows = split(situation, "||")
3939 let cell = [split(rows[0], "|"), split(rows[1], "|"), split(rows[2], "|"), split(rows[3], "|"), split(rows[4], "|"), split(rows[5], "|"), split(rows[6], "|"), split(rows[7], "|")]
4040 if ((figure == "p"))
4141 then if ((side == "w"))
4242 then if ((tolist[3] == "b"))
4343 then if (if (((fromy - toy) == 1))
4444 then if (((fromx - tox) == 1))
4545 then true
4646 else ((fromx - tox) == 1)
4747 else false)
4848 then [StringEntry("-", "-")]
4949 else throw("incorrect eating")
5050 else {
5151 let c = split(cell[fromx][(fromy - 1)], "")
5252 let freecell = if ((c[3] == "0"))
5353 then true
5454 else false
5555 if (if ((fromx == tox))
5656 then if (((fromy - tox) == 1))
5757 then true
5858 else if (((fromx - tox) == 2))
5959 then freecell
6060 else false
6161 else false)
6262 then [StringEntry("moved", ((("from-" + from) + " to-") + to))]
6363 else throw("incorrect move")
6464 }
6565 else [StringEntry("-", "-")]
6666 else [StringEntry("-", "-")]
6767 }
68- else throw("not siotuation")
68+ else throw("not situation")
6969 }
7070 else throw("not your turn")
7171 }
7272 else throw("not gamer")
7373 }
7474 else throw("not ongoing game")
7575 }
7676
7777
7878
7979 @Callable(i)
8080 func startgame (challengeid) = {
8181 let pmt = if ((size(i.payments) == 1))
8282 then i.payments[0]
8383 else throw("must stake some waves")
8484 if (isDefined(pmt.assetId))
8585 then throw("works with waves only")
8686 else {
8787 let callerAdress = toBase58String(i.caller.bytes)
8888 let conditions = split(getStringValue(("challenge-" + challengeid)), separ)
8989 if ((size(conditions) > 0))
9090 then if ((pmt.amount >= parseIntValue(conditions[3])))
9191 then if ((conditions[0] == "awaiting"))
9292 then {
9393 let black = if ((conditions[2] == "b"))
9494 then conditions[1]
9595 else callerAdress
9696 let white = if ((conditions[2] == "w"))
9797 then conditions[1]
9898 else callerAdress
9999 let gameid = toString((parseIntValue(getStringValue("lastgameid")) + 1))
100100 [StringEntry(("challenge-" + challengeid), makeString([gameid, conditions[1], conditions[2], conditions[3], callerAdress], separ)), {
101101 let situation = "00:w:l|10:w:h|20:w:e|30:w:f|40:w:q|50:w:e|60:w:h|70:w:l||01:w:p|11:w:p|21:w:p|31:w:p|41:w:p|51:w:p|61:w:p|71:w:p||02:0:0|12:0:0|22:0:0|32:0:0|42:0:0|52:0:0|62:0:0|72:0:0||03:0:0|13:0:0|23:0:0|33:0:0|43:0:0|53:0:0|63:0:0|73:0:0||04:0:0|14:0:0|24:0:0|34:0:0|44:0:0|54:0:0|64:0:0|74:0:0||05:0:0|15:0:0|25:0:0|35:0:0|45:0:0|55:0:0|65:0:0|75:0:0||06:b:p|16:w:p|26:w:p|36:w:p|46:w:p|56:w:p|66:w:p|76:w:p||07:b:l|17:b:h|27:b:e|37:b:f|47:b:q|57:b:e|67:b:h|77:b:l"
102102 StringEntry(("game-" + gameid), makeString(["ongoing", white, black, conditions[3], "0", "w", "startblock", "laststepblock", situation], separ))
103103 }, StringEntry("lastgameid", gameid), ScriptTransfer(i.caller, (pmt.amount - parseIntValue(conditions[3])), unit)]
104104 }
105105 else throw("no challenge awaiting")
106106 else throw("need more money")
107107 else throw("no challenge")
108108 }
109109 }
110110
111111
112112
113113 @Callable(i)
114114 func setchallenge (side) = if (if ((side == "b"))
115115 then true
116116 else (side == "w"))
117117 then {
118118 let pmt = if ((size(i.payments) == 1))
119119 then i.payments[0]
120120 else throw("must stake some waves")
121121 if (isDefined(pmt.assetId))
122122 then throw("works with waves only")
123123 else {
124124 let callerAdress = toBase58String(i.caller.bytes)
125125 let challengeid = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
126126 [StringEntry(("challenge-" + challengeid), makeString(["awaiting", callerAdress, side, toString(pmt.amount)], separ)), StringEntry("lastchallengeid", challengeid)]
127127 }
128128 }
129129 else throw("invalid side")
130130
131131
132132
133133 @Callable(i)
134134 func unsetchallenge (challendgeid) = {
135135 let callerAdress = toBase58String(i.caller.bytes)
136136 func getchallenge (challendgeid) = match getString(("challenge-" + challendgeid)) {
137137 case a: String =>
138138 getStringValue(("challenge-" + challendgeid))
139139 case _ =>
140140 ""
141141 }
142142
143143 let challenge = split(getchallenge(challendgeid), separ)
144144 if ((size(challenge) > 0))
145145 then if ((challenge[0] == "awaiting"))
146146 then [StringEntry(("challenge-" + challendgeid), makeString(["unset", challenge[1], challenge[2], challenge[3]], separ))]
147147 else throw("challenge not exists")
148148 else throw("challenge not exists")
149149 }
150150
151151

github/deemru/w8io/169f3d6 
56.89 ms