tx · FQz658xPrggZa8WML27K9ZWDzihjTA6v3Dz4mGaHrUxJ

3N8JKQJJbpd1boMc5ehpBC9q6rofxeP6Los:  -0.01000000 Waves

2019.09.13 15:54 [674442] smart account 3N8JKQJJbpd1boMc5ehpBC9q6rofxeP6Los > SELF 0.00000000 Waves

{ "type": 13, "id": "FQz658xPrggZa8WML27K9ZWDzihjTA6v3Dz4mGaHrUxJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1568379155628, "version": 1, "sender": "3N8JKQJJbpd1boMc5ehpBC9q6rofxeP6Los", "senderPublicKey": "C1pPxXCjPX5J3mbc8zwoFibr7onMUE8kXPSkuZt3hvMK", "proofs": [ "uAHrZ1GzUrC3AxHDEX933Ni8UVyseUThm2Ezi2WHw6JFy7UmTdJrBpXRD7shrRxHte3UaCiicjE9v3SwRWWtxiN" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAQAAABNnZXRHYW1lU3RhdGVTdHJBdHRyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMJAAACAAAAAQkAASwAAAACCQABLAAAAAICAAAAGmludmFsaWQgZ2FtZSBzdGF0ZSwga2V5OiAnBQAAAANrZXkCAAAACycgbm90IGZvdW5kAAAAAgAAAAFpAQAAAA1jcmVhdGVOZXdHYW1lAAAAAgAAAAJwMQAAAAJwMgQAAAAGZ2FtZUlkCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAGZ2FtZUlkAgAAAANfcDEFAAAAAnAxCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAABmdhbWVJZAIAAAADX3AyBQAAAAJwMgkABEwAAAACCQEAAA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AAAAAIJAAEsAAAAAgIAAAAMbm90IHBsYXllcnMgBQAAAA1wbGF5ZXJBZGRyZXNzAgAAAAYgdHVybiEAAAAANsZn0Q==", "chainId": 84, "height": 674442, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func getGameStateStrAttr (key) = match getString(this, key) {
5+ case s: String =>
6+ s
7+ case _ =>
8+ throw((("invalid game state, key: '" + key) + "' not found"))
9+}
10+
11+
12+@Callable(i)
13+func createNewGame (p1,p2) = {
14+ let gameId = toBase58String(i.transactionId)
15+ WriteSet([DataEntry((gameId + "_p1"), p1), DataEntry((gameId + "_p2"), p2), DataEntry((gameId + "_turn"), p1), DataEntry((gameId + "_board"), "0")])
16+ }
17+
18+
19+
20+@Callable(i)
21+func play (gameId,number) = {
22+ let playerAddress = toBase58String(i.caller.bytes)
23+ let p1 = getGameStateStrAttr((gameId + "_p1"))
24+ let p2 = getGameStateStrAttr((gameId + "_p2"))
25+ let turn = getGameStateStrAttr((gameId + "_turn"))
26+ let board = getGameStateStrAttr((gameId + "_board"))
27+ if ((0 >= number))
28+ then throw("number has to be > 1")
29+ else if ((turn == playerAddress))
30+ then WriteSet([DataEntry((gameId + "_turn"), if ((turn == p1))
31+ then p2
32+ else p1), DataEntry((gameId + "_board"), ((board + " | ") + toString(number)))])
33+ else throw((("not players " + playerAddress) + " turn!"))
34+ }
35+
36+

github/deemru/w8io/169f3d6 
19.07 ms