tx · 4x1e9BHs33GTiCpzzbZ9fWULeyjaoX8f47UdARoBfJn8 3MrTMXEvaz63AHA6K7U5hDgTY54gZZe3R4g: -0.01400000 Waves 2019.03.05 18:17 [522798] smart account 3MrTMXEvaz63AHA6K7U5hDgTY54gZZe3R4g > SELF 0.00000000 Waves
{ "type": 13, "id": "4x1e9BHs33GTiCpzzbZ9fWULeyjaoX8f47UdARoBfJn8", "fee": 1400000, "feeAssetId": null, "timestamp": 1551799078565, "version": 1, "sender": "3MrTMXEvaz63AHA6K7U5hDgTY54gZZe3R4g", "senderPublicKey": "CEx6vd7D5Czxcfshd4vLpSw4LEmGULQw5avVZ7Vfrzgo", "proofs": [ "2nSpxr7aM21mEY5jty5BuVXG9mTtHhAT1MYHXDW1cgtZMTAvwUvFtfvnzvtG8QKAezwe2UC467Y8vDbuntLV1h5c" ], "script": "base64:AQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAACZHQFAAAAByRtYXRjaDAEAAAABHR5cGUJAQAAAAdleHRyYWN0AAAAAQkABBMAAAACCAUAAAACZHQAAAAEZGF0YQIAAAAEdHlwZQQAAAAGZ2FtZUlkCQEAAAAHZXh0cmFjdAAAAAEJAAQTAAAAAggFAAAAAmR0AAAABGRhdGECAAAABmdhbWVJZAQAAAAMc2VydmVyU2lnbmVkCQAB9AAAAAMIBQAAAAJkdAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmR0AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAAAAAAAAgUAAAAEdHlwZQIAAAAFc3RhcnQEAAAACWJldEFtb3VudAkBAAAAB2V4dHJhY3QAAAABCQAEEAAAAAIIBQAAAAJkdAAAAARkYXRhCQABLAAAAAIFAAAABmdhbWVJZAIAAAAHX2Ftb3VudAQAAAAHcGxheWVyMQkBAAAAB2V4dHJhY3QAAAABCQAE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gFAAAAAnR0AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHQAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAACc3QFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnN0AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACc3QAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B+MBmXM=", "chainId": 84, "height": 522798, "spentComplexity": 0 } View: original | compacted Prev: DqdYACqjeeW2kjvXb8eeeyzffMVoRi28jP9j2ErCcMmc Next: HpVWr5r51M4AeuXgMYWD8jhoZR7j1pLy9CCQf7SgivBc Diff:
Old | New | Differences | |
---|---|---|---|
52 | 52 | else false) | |
53 | 53 | then dtStartDataDefined | |
54 | 54 | else false) | |
55 | - | then | |
55 | + | then true | |
56 | 56 | else throw("dtx:start - fail") | |
57 | 57 | } | |
58 | 58 | else if ((type == "finish")) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | match tx { | |
4 | 4 | case dt: DataTransaction => | |
5 | 5 | let type = extract(getString(dt.data, "type")) | |
6 | 6 | let gameId = extract(getString(dt.data, "gameId")) | |
7 | 7 | let serverSigned = sigVerify(dt.bodyBytes, dt.proofs[0], tx.senderPublicKey) | |
8 | 8 | if ((type == "start")) | |
9 | 9 | then { | |
10 | 10 | let betAmount = extract(getInteger(dt.data, (gameId + "_amount"))) | |
11 | 11 | let player1 = extract(getString(dt.data, (gameId + "_player1"))) | |
12 | 12 | let player1TxId = extract(getString(dt.data, (gameId + "_tx1"))) | |
13 | 13 | let player2 = extract(getString(dt.data, (gameId + "_player2"))) | |
14 | 14 | let player2TxId = extract(getString(dt.data, (gameId + "_tx2"))) | |
15 | 15 | let dtStartDataDefined = if (if (if (isDefined(getInteger(dt.data, (gameId + "_winAmount")))) | |
16 | 16 | then isDefined(getBinary(dt.data, (gameId + "_squadronHash"))) | |
17 | 17 | else false) | |
18 | 18 | then isDefined(getBoolean(dt.data, ("used_tx_" + player1TxId))) | |
19 | 19 | else false) | |
20 | 20 | then isDefined(getBoolean(dt.data, ("used_tx_" + player2TxId))) | |
21 | 21 | else false | |
22 | 22 | let player1Tx = transactionById(fromBase58String(player1TxId)) | |
23 | 23 | let player2Tx = transactionById(fromBase58String(player2TxId)) | |
24 | 24 | let tr1Ok = match player1Tx { | |
25 | 25 | case t: TransferTransaction => | |
26 | 26 | if (if (if ((t.amount == betAmount)) | |
27 | 27 | then !(isDefined(t.assetId)) | |
28 | 28 | else false) | |
29 | 29 | then (extract(getString(dt.data, ("game_" + toBase58String(addressFromPublicKey(fromBase58String(player1)).bytes)))) == gameId) | |
30 | 30 | else false) | |
31 | 31 | then (t.recipient == tx.sender) | |
32 | 32 | else false | |
33 | 33 | case _ => | |
34 | 34 | false | |
35 | 35 | } | |
36 | 36 | let tr2Ok = match player2Tx { | |
37 | 37 | case t: TransferTransaction => | |
38 | 38 | if (if (if ((t.amount == betAmount)) | |
39 | 39 | then !(isDefined(t.assetId)) | |
40 | 40 | else false) | |
41 | 41 | then (extract(getString(dt.data, ("game_" + toBase58String(addressFromPublicKey(fromBase58String(player2)).bytes)))) == gameId) | |
42 | 42 | else false) | |
43 | 43 | then (t.recipient == tx.sender) | |
44 | 44 | else false | |
45 | 45 | case _ => | |
46 | 46 | false | |
47 | 47 | } | |
48 | 48 | if (if (if (if (serverSigned) | |
49 | 49 | then tr1Ok | |
50 | 50 | else false) | |
51 | 51 | then tr2Ok | |
52 | 52 | else false) | |
53 | 53 | then dtStartDataDefined | |
54 | 54 | else false) | |
55 | - | then | |
55 | + | then true | |
56 | 56 | else throw("dtx:start - fail") | |
57 | 57 | } | |
58 | 58 | else if ((type == "finish")) | |
59 | 59 | then { | |
60 | 60 | let squadron1 = extract(getBinary(dt.data, (gameId + "_squadron1"))) | |
61 | 61 | let squadron2 = extract(getBinary(dt.data, (gameId + "_squadron2"))) | |
62 | 62 | let gameSalt = extract(getBinary(dt.data, (gameId + "_salt"))) | |
63 | 63 | let correctSquadrons = (sha256(((squadron1 + squadron2) + gameSalt)) == extract(getBinary(tx.sender, (gameId + "_squadronHash")))) | |
64 | 64 | if (correctSquadrons) | |
65 | 65 | then throw("correct squadrons") | |
66 | 66 | else throw("incorrect squadrons") | |
67 | 67 | } | |
68 | 68 | else if ((type == "payout")) | |
69 | 69 | then throw("dtx:payout - success") | |
70 | 70 | else if ((type == "refund")) | |
71 | 71 | then throw("dtx:refund - success") | |
72 | 72 | else throw(("dtx:type_unknown " + type)) | |
73 | 73 | case tt: TransferTransaction => | |
74 | 74 | sigVerify(tt.bodyBytes, tt.proofs[0], tx.senderPublicKey) | |
75 | 75 | case st: SetScriptTransaction => | |
76 | 76 | sigVerify(st.bodyBytes, st.proofs[0], tx.senderPublicKey) | |
77 | 77 | case _ => | |
78 | 78 | false | |
79 | 79 | } |
github/deemru/w8io/169f3d6 46.74 ms ◑