tx · 5ehFhHmVg3aZJX7wthgQMpTNf9ctEcMYwXQzT5tbGrHS 3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os: -0.01400000 Waves 2020.07.21 13:47 [1097127] smart account 3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os > SELF 0.00000000 Waves
{ "type": 13, "id": "5ehFhHmVg3aZJX7wthgQMpTNf9ctEcMYwXQzT5tbGrHS", "fee": 1400000, "feeAssetId": null, "timestamp": 1595328438900, "version": 1, "sender": "3N37A69qLQj49KGRgWhx9C8Zxb1UjHfL8os", "senderPublicKey": "2H7prj9bMBS9xMv4iNhFyNLKx38JpRZ6tnf1GNHu9xUX", "proofs": [ "3aQTPssGpBiRS8qKLGRiDurXUDpAxjDPMc9Qw82ycGmmHHPtVJ5gDr1KmjZK8QKKpq38dmtVLmNMgi8hSbsG3ksd" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIFCgMBAQEAAAAIAQAAAAlnZXRDb29yZHMAAAABAAAAA2tleQkABEwAAAACCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAMcG9zaXRpb25MYXRfBQAAAANrZXkJAARMAAAAAgkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAADXBvc2l0aW9uTG9uZ18FAAAAA2tleQUAAAADbmlsAQAAAAlzZXRDb29yZHMAAAADAAAAA2tleQAAAAhsYXRpdHVkZQAAAAlsb25naXR1ZGUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAMcG9zaXRpb25MYXRfBQAAAANrZXkFAAAACGxhdGl0dWRlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAADXBvc2l0aW9uTG9uZ18FAAAAA2tleQUAAAAJbG9uZ2l0dWRlBQAAAANuaWwBAAAAC3NldEdhbWVEYXRhAAAAAgAAAANpZDAAAAADaWQxBAAAAAZnYW1lSWQJAAEsAAAAAgkAASwAAAACBQAAAANpZDACAAAAAV8FAA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EJAQAAAAxjaGFuZ2VQbGF5ZXIAAAABBQAAAAZjYWxsZXIAAAAADA9bZA==", "chainId": 84, "height": 1097127, "spentComplexity": 0 } View: original | compacted Prev: 7kyXjvAqah74bzw8FGx31V31u1AxXisiwy4kJjRH1Mqr Next: 7T2Bq9cFUWZJ9CELsMRJySSchaA3yikK6iiNgD4EWBeW Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | func c (b,d,e) = [DataEntry(("positionLat_" + b), d), DataEntry(("positionLong_" + b), e)] | |
8 | 8 | ||
9 | 9 | ||
10 | - | @Callable(f) | |
10 | + | func f (g,h) = { | |
11 | + | let i = ((g + "_") + h) | |
12 | + | [DataEntry(("gameId_" + g), i), DataEntry(("opponent_" + g), h), DataEntry(("gameId_" + h), i), DataEntry(("opponent_" + h), g), DataEntry(("game_" + i), true), DataEntry(("gameTurn_" + i), g), DataEntry(("gameWinner_" + i), "")] | |
13 | + | } | |
14 | + | ||
15 | + | ||
16 | + | func j (b) = getStringValue(this, ("gameId_" + b)) | |
17 | + | ||
18 | + | ||
19 | + | func k (g) = { | |
20 | + | let i = j(g) | |
21 | + | let h = getStringValue(this, ("opponent_" + g)) | |
22 | + | [DataEntry(("gameId_" + g), ""), DataEntry(("gameId_" + h), ""), DataEntry(("game_" + i), false), DataEntry(("gameTurn_" + i), "")] | |
23 | + | } | |
24 | + | ||
25 | + | ||
26 | + | func l (g) = if ((getStringValue(this, ("gameTurn_" + j(g))) == g)) | |
27 | + | then true | |
28 | + | else false | |
29 | + | ||
30 | + | ||
31 | + | func m (g) = [DataEntry(("gameTurn_" + j(g)), getStringValue(this, ("opponent_" + g)))] | |
32 | + | ||
33 | + | ||
34 | + | func n (o,p,q) = if ((o == p)) | |
35 | + | then true | |
36 | + | else false | |
37 | + | ||
38 | + | ||
39 | + | @Callable(r) | |
11 | 40 | func startGame (d,e) = { | |
12 | - | let g = toString(f.caller) | |
13 | - | let h = c(g, d, e) | |
14 | - | let i = getString(this, "openGame") | |
15 | - | if (!(isDefined(i))) | |
16 | - | then WriteSet(DataEntry("openGame", g) :: h) | |
17 | - | else if (if ((i == "")) | |
18 | - | then true | |
19 | - | else (i == g)) | |
20 | - | then WriteSet(DataEntry("openGame", g) :: h) | |
21 | - | else WriteSet([DataEntry("openGame", ""), DataEntry(((("game_" + value(i)) + "_") + g), true)] :: h) | |
41 | + | let s = toString(r.caller) | |
42 | + | let t = c(s, d, e) | |
43 | + | let u = getString(this, "openGame") | |
44 | + | if ((j(s) != "")) | |
45 | + | then throw("Please finish your current game, before starting another one") | |
46 | + | else if (!(isDefined(u))) | |
47 | + | then WriteSet(DataEntry("openGame", s) :: t) | |
48 | + | else if (if ((u == "")) | |
49 | + | then true | |
50 | + | else (u == s)) | |
51 | + | then WriteSet(DataEntry("openGame", s) :: t) | |
52 | + | else WriteSet([DataEntry("openGame", ""), t[0], t[1], f(value(u), s)]) | |
53 | + | } | |
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | @Callable(r) | |
58 | + | func executeShot (o,p,q) = { | |
59 | + | let s = toString(r.caller) | |
60 | + | if (!(l(s))) | |
61 | + | then throw("please wait for your turn") | |
62 | + | else if (n(o, p, q)) | |
63 | + | then WriteSet(k(s)) | |
64 | + | else WriteSet(m(s)) | |
22 | 65 | } | |
23 | 66 | ||
24 | 67 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = [getInteger(this, ("positionLat_" + b)), getInteger(this, ("positionLong_" + b))] | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func c (b,d,e) = [DataEntry(("positionLat_" + b), d), DataEntry(("positionLong_" + b), e)] | |
8 | 8 | ||
9 | 9 | ||
10 | - | @Callable(f) | |
10 | + | func f (g,h) = { | |
11 | + | let i = ((g + "_") + h) | |
12 | + | [DataEntry(("gameId_" + g), i), DataEntry(("opponent_" + g), h), DataEntry(("gameId_" + h), i), DataEntry(("opponent_" + h), g), DataEntry(("game_" + i), true), DataEntry(("gameTurn_" + i), g), DataEntry(("gameWinner_" + i), "")] | |
13 | + | } | |
14 | + | ||
15 | + | ||
16 | + | func j (b) = getStringValue(this, ("gameId_" + b)) | |
17 | + | ||
18 | + | ||
19 | + | func k (g) = { | |
20 | + | let i = j(g) | |
21 | + | let h = getStringValue(this, ("opponent_" + g)) | |
22 | + | [DataEntry(("gameId_" + g), ""), DataEntry(("gameId_" + h), ""), DataEntry(("game_" + i), false), DataEntry(("gameTurn_" + i), "")] | |
23 | + | } | |
24 | + | ||
25 | + | ||
26 | + | func l (g) = if ((getStringValue(this, ("gameTurn_" + j(g))) == g)) | |
27 | + | then true | |
28 | + | else false | |
29 | + | ||
30 | + | ||
31 | + | func m (g) = [DataEntry(("gameTurn_" + j(g)), getStringValue(this, ("opponent_" + g)))] | |
32 | + | ||
33 | + | ||
34 | + | func n (o,p,q) = if ((o == p)) | |
35 | + | then true | |
36 | + | else false | |
37 | + | ||
38 | + | ||
39 | + | @Callable(r) | |
11 | 40 | func startGame (d,e) = { | |
12 | - | let g = toString(f.caller) | |
13 | - | let h = c(g, d, e) | |
14 | - | let i = getString(this, "openGame") | |
15 | - | if (!(isDefined(i))) | |
16 | - | then WriteSet(DataEntry("openGame", g) :: h) | |
17 | - | else if (if ((i == "")) | |
18 | - | then true | |
19 | - | else (i == g)) | |
20 | - | then WriteSet(DataEntry("openGame", g) :: h) | |
21 | - | else WriteSet([DataEntry("openGame", ""), DataEntry(((("game_" + value(i)) + "_") + g), true)] :: h) | |
41 | + | let s = toString(r.caller) | |
42 | + | let t = c(s, d, e) | |
43 | + | let u = getString(this, "openGame") | |
44 | + | if ((j(s) != "")) | |
45 | + | then throw("Please finish your current game, before starting another one") | |
46 | + | else if (!(isDefined(u))) | |
47 | + | then WriteSet(DataEntry("openGame", s) :: t) | |
48 | + | else if (if ((u == "")) | |
49 | + | then true | |
50 | + | else (u == s)) | |
51 | + | then WriteSet(DataEntry("openGame", s) :: t) | |
52 | + | else WriteSet([DataEntry("openGame", ""), t[0], t[1], f(value(u), s)]) | |
53 | + | } | |
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | @Callable(r) | |
58 | + | func executeShot (o,p,q) = { | |
59 | + | let s = toString(r.caller) | |
60 | + | if (!(l(s))) | |
61 | + | then throw("please wait for your turn") | |
62 | + | else if (n(o, p, q)) | |
63 | + | then WriteSet(k(s)) | |
64 | + | else WriteSet(m(s)) | |
22 | 65 | } | |
23 | 66 | ||
24 | 67 |
github/deemru/w8io/169f3d6 45.13 ms ◑