tx · 7T2Bq9cFUWZJ9CELsMRJySSchaA3yikK6iiNgD4EWBeW

3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os:  -0.01400000 Waves

2020.07.21 14:54 [1097190] smart account 3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os > SELF 0.00000000 Waves

{ "type": 13, "id": "7T2Bq9cFUWZJ9CELsMRJySSchaA3yikK6iiNgD4EWBeW", "fee": 1400000, "feeAssetId": null, "timestamp": 1595332478322, "version": 1, "sender": "3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os", "senderPublicKey": "2H7prj9bMBS9xMv4iNhFyNLKx38JpRZ6tnf1GNHu9xUX", "proofs": [ "4wRK2K8WretERxMcQAsYhjcSgC1rVsD45yiNqBq4Gy5ZdpLktR5jMrAFjvcumMJDAy6jZGp4FdTeVLd8rby7DSre" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIFCgMBAQEAAAAIAQAAAAlnZXRDb29yZHMAAAABAAAAA2tleQkABEwAAAACCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAMcG9zaXRpb25MYXRfBQAAAANrZXkJAARMAAAAAgkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAADXBvc2l0aW9uTG9uZ18FAAAAA2tleQUAAAADbmlsAQAAAAlzZXRDb29yZHMAAAADAAAAA2tleQAAAAhsYXRpdHVkZQAAAAlsb25naXR1ZGUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAMcG9zaXRpb25MYXRfBQAAAANrZXkFAAAACGxhdGl0dWRlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAADXBvc2l0aW9uTG9uZ18FAAAAA2tleQUAAAAJbG9uZ2l0dWRlBQAAAANuaWwBAAAAC3NldEdhbWVEYXRhAAAAAgAAAANpZDAAAAADaWQxBAAAAAZnYW1lSWQJAAEsAAAAAgkAASwAAAACBQAAAANpZDACAAAAAV8FAAAAA2l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AAAAFcGl0Y2gFAAAAA3lhdwUAAAAFZm9yY2UJAQAAAAhXcml0ZVNldAAAAAEJAQAAAA11bnNldEdhbWVEYXRhAAAAAQUAAAAGY2FsbGVyCQEAAAAIV3JpdGVTZXQAAAABCQEAAAAMY2hhbmdlUGxheWVyAAAAAQUAAAAGY2FsbGVyAAAAALDjtiQ=", "chainId": 84, "height": 1097190, "spentComplexity": 0 } View: original | compacted Prev: 5ehFhHmVg3aZJX7wthgQMpTNf9ctEcMYwXQzT5tbGrHS Next: FTjSYj5JvJfyn9D6smakoyRVSFFfZ4Pgj32fJorAKTvd Diff:
OldNewDifferences
1313 }
1414
1515
16-func getGameId (key) = getStringValue(this, ("gameId_" + key))
16+func getGameId (key) = getString(this, ("gameId_" + key))
1717
1818
1919 func unsetGameData (id0) = {
20- let gameId = getGameId(id0)
20+ let gameId = value(getGameId(id0))
2121 let id1 = getStringValue(this, ("opponent_" + id0))
2222 [DataEntry(("gameId_" + id0), ""), DataEntry(("gameId_" + id1), ""), DataEntry(("game_" + gameId), false), DataEntry(("gameTurn_" + gameId), "")]
2323 }
2424
2525
26-func isPlayerTurn (id0) = if ((getStringValue(this, ("gameTurn_" + getGameId(id0))) == id0))
26+func isPlayerTurn (id0) = if ((getStringValue(this, ("gameTurn_" + value(getGameId(id0)))) == id0))
2727 then true
2828 else false
2929
3030
31-func changePlayer (id0) = [DataEntry(("gameTurn_" + getGameId(id0)), getStringValue(this, ("opponent_" + id0)))]
31+func changePlayer (id0) = [DataEntry(("gameTurn_" + value(getGameId(id0))), getStringValue(this, ("opponent_" + id0)))]
3232
3333
3434 func gotHit (pitch,yaw,force) = if ((pitch == yaw))
4141 let caller = toString(i.caller)
4242 let coordinates = setCoords(caller, latitude, longitude)
4343 let openGame = getString(this, "openGame")
44- if ((getGameId(caller) != ""))
44+ let gameId = getGameId(caller)
45+ if (if ((gameId != ""))
46+ then (gameId != unit)
47+ else false)
4548 then throw("Please finish your current game, before starting another one")
4649 else if (!(isDefined(openGame)))
4750 then WriteSet(DataEntry("openGame", caller) :: coordinates)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getCoords (key) = [getInteger(this, ("positionLat_" + key)), getInteger(this, ("positionLong_" + key))]
55
66
77 func setCoords (key,latitude,longitude) = [DataEntry(("positionLat_" + key), latitude), DataEntry(("positionLong_" + key), longitude)]
88
99
1010 func setGameData (id0,id1) = {
1111 let gameId = ((id0 + "_") + id1)
1212 [DataEntry(("gameId_" + id0), gameId), DataEntry(("opponent_" + id0), id1), DataEntry(("gameId_" + id1), gameId), DataEntry(("opponent_" + id1), id0), DataEntry(("game_" + gameId), true), DataEntry(("gameTurn_" + gameId), id0), DataEntry(("gameWinner_" + gameId), "")]
1313 }
1414
1515
16-func getGameId (key) = getStringValue(this, ("gameId_" + key))
16+func getGameId (key) = getString(this, ("gameId_" + key))
1717
1818
1919 func unsetGameData (id0) = {
20- let gameId = getGameId(id0)
20+ let gameId = value(getGameId(id0))
2121 let id1 = getStringValue(this, ("opponent_" + id0))
2222 [DataEntry(("gameId_" + id0), ""), DataEntry(("gameId_" + id1), ""), DataEntry(("game_" + gameId), false), DataEntry(("gameTurn_" + gameId), "")]
2323 }
2424
2525
26-func isPlayerTurn (id0) = if ((getStringValue(this, ("gameTurn_" + getGameId(id0))) == id0))
26+func isPlayerTurn (id0) = if ((getStringValue(this, ("gameTurn_" + value(getGameId(id0)))) == id0))
2727 then true
2828 else false
2929
3030
31-func changePlayer (id0) = [DataEntry(("gameTurn_" + getGameId(id0)), getStringValue(this, ("opponent_" + id0)))]
31+func changePlayer (id0) = [DataEntry(("gameTurn_" + value(getGameId(id0))), getStringValue(this, ("opponent_" + id0)))]
3232
3333
3434 func gotHit (pitch,yaw,force) = if ((pitch == yaw))
3535 then true
3636 else false
3737
3838
3939 @Callable(i)
4040 func startGame (latitude,longitude) = {
4141 let caller = toString(i.caller)
4242 let coordinates = setCoords(caller, latitude, longitude)
4343 let openGame = getString(this, "openGame")
44- if ((getGameId(caller) != ""))
44+ let gameId = getGameId(caller)
45+ if (if ((gameId != ""))
46+ then (gameId != unit)
47+ else false)
4548 then throw("Please finish your current game, before starting another one")
4649 else if (!(isDefined(openGame)))
4750 then WriteSet(DataEntry("openGame", caller) :: coordinates)
4851 else if (if ((openGame == ""))
4952 then true
5053 else (openGame == caller))
5154 then WriteSet(DataEntry("openGame", caller) :: coordinates)
5255 else WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], setGameData(value(openGame), caller)])
5356 }
5457
5558
5659
5760 @Callable(i)
5861 func executeShot (pitch,yaw,force) = {
5962 let caller = toString(i.caller)
6063 if (!(isPlayerTurn(caller)))
6164 then throw("please wait for your turn")
6265 else if (gotHit(pitch, yaw, force))
6366 then WriteSet(unsetGameData(caller))
6467 else WriteSet(changePlayer(caller))
6568 }
6669
6770

github/deemru/w8io/026f985 
30.10 ms