tx · FTjSYj5JvJfyn9D6smakoyRVSFFfZ4Pgj32fJorAKTvd

3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os:  -0.01400000 Waves

2020.07.21 15:16 [1097214] smart account 3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os > SELF 0.00000000 Waves

{ "type": 13, "id": "FTjSYj5JvJfyn9D6smakoyRVSFFfZ4Pgj32fJorAKTvd", "fee": 1400000, "feeAssetId": null, "timestamp": 1595333808159, "version": 1, "sender": "3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os", "senderPublicKey": "2H7prj9bMBS9xMv4iNhFyNLKx38JpRZ6tnf1GNHu9xUX", "proofs": [ "2hzDBNX5UdcLX5aDW8BFgMw7x9VkDZG1Xu7bnJERU8rK1STYCKNeVcMmZEoMtvFa566VnDc9iKVomnYBVEdMbDcM" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIFCgMBAQEAAAAIAQAAAAlnZXRDb29yZHMAAAABAAAAA2tleQkABEwAAAACCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAMcG9zaXRpb25MYXRfBQAAAANrZXkJAARMAAAAAgkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAADXBvc2l0aW9uTG9uZ18FAAAAA2tleQUAAAADbmlsAQAAAAlzZXRDb29yZHMAAAADAAAAA2tleQAAAAhsYXRpdHVkZQAAAAlsb25naXR1ZGUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAMcG9zaXRpb25MYXRfBQAAAANrZXkFAAAACGxhdGl0dWRlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAADXBvc2l0aW9uTG9uZ18FAAAAA2tleQUAAAAJbG9uZ2l0dWRlBQAAAANuaWwBAAAAC3NldEdhbWVEYXRhAAAAAgAAAANpZDAAAAADaWQxBAAAAAZnYW1lSWQJAAEsAAAAAgkAASwAAAACBQAAAANpZDACAAAAAV8FAAAAA2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AABmNhbGxlcgkAAAIAAAABAgAAABlwbGVhc2Ugd2FpdCBmb3IgeW91ciB0dXJuAwkBAAAABmdvdEhpdAAAAAMFAAAABXBpdGNoBQAAAAN5YXcFAAAABWZvcmNlCQEAAAAIV3JpdGVTZXQAAAABCQEAAAANdW5zZXRHYW1lRGF0YQAAAAEFAAAABmNhbGxlcgkBAAAACFdyaXRlU2V0AAAAAQkBAAAADGNoYW5nZVBsYXllcgAAAAEFAAAABmNhbGxlcgAAAAB0JImq", "chainId": 84, "height": 1097214, "spentComplexity": 0 } View: original | compacted Prev: 7T2Bq9cFUWZJ9CELsMRJySSchaA3yikK6iiNgD4EWBeW Next: none Diff:
OldNewDifferences
1919 func unsetGameData (id0) = {
2020 let gameId = value(getGameId(id0))
2121 let id1 = getStringValue(this, ("opponent_" + id0))
22-[DataEntry(("gameId_" + id0), ""), DataEntry(("gameId_" + id1), ""), DataEntry(("game_" + gameId), false), DataEntry(("gameTurn_" + gameId), "")]
22+[DataEntry(("gameId_" + id0), ""), DataEntry(("gameId_" + id1), ""), DataEntry(("game_" + gameId), false), DataEntry(("gameTurn_" + gameId), ""), DataEntry(("gameWinner_" + gameId), id0)]
2323 }
2424
2525
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
1616 func getGameId (key) = getString(this, ("gameId_" + key))
1717
1818
1919 func unsetGameData (id0) = {
2020 let gameId = value(getGameId(id0))
2121 let id1 = getStringValue(this, ("opponent_" + id0))
22-[DataEntry(("gameId_" + id0), ""), DataEntry(("gameId_" + id1), ""), DataEntry(("game_" + gameId), false), DataEntry(("gameTurn_" + gameId), "")]
22+[DataEntry(("gameId_" + id0), ""), DataEntry(("gameId_" + id1), ""), DataEntry(("game_" + gameId), false), DataEntry(("gameTurn_" + gameId), ""), DataEntry(("gameWinner_" + gameId), id0)]
2323 }
2424
2525
2626 func isPlayerTurn (id0) = if ((getStringValue(this, ("gameTurn_" + value(getGameId(id0)))) == id0))
2727 then true
2828 else false
2929
3030
3131 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")
4444 let gameId = getGameId(caller)
4545 if (if ((gameId != ""))
4646 then (gameId != unit)
4747 else false)
4848 then throw("Please finish your current game, before starting another one")
4949 else if (!(isDefined(openGame)))
5050 then WriteSet(DataEntry("openGame", caller) :: coordinates)
5151 else if (if ((openGame == ""))
5252 then true
5353 else (openGame == caller))
5454 then WriteSet(DataEntry("openGame", caller) :: coordinates)
5555 else WriteSet([DataEntry("openGame", ""), coordinates[0], coordinates[1], setGameData(value(openGame), caller)])
5656 }
5757
5858
5959
6060 @Callable(i)
6161 func executeShot (pitch,yaw,force) = {
6262 let caller = toString(i.caller)
6363 if (!(isPlayerTurn(caller)))
6464 then throw("please wait for your turn")
6565 else if (gotHit(pitch, yaw, force))
6666 then WriteSet(unsetGameData(caller))
6767 else WriteSet(changePlayer(caller))
6868 }
6969
7070

github/deemru/w8io/169f3d6 
27.45 ms