tx · 7unPpKJsW5UzWeU7XXwKLviBQHp5hq4dGdGH5aJPWFuS

3MrTMXEvaz63AHA6K7U5hDgTY54gZZe3R4g:  -0.01400000 Waves

2019.03.18 19:28 [541916] smart account 3MrTMXEvaz63AHA6K7U5hDgTY54gZZe3R4g > SELF 0.00000000 Waves

{ "type": 13, "id": "7unPpKJsW5UzWeU7XXwKLviBQHp5hq4dGdGH5aJPWFuS", "fee": 1400000, "feeAssetId": null, "timestamp": 1552926643457, "version": 1, "sender": "3MrTMXEvaz63AHA6K7U5hDgTY54gZZe3R4g", "senderPublicKey": "CEx6vd7D5Czxcfshd4vLpSw4LEmGULQw5avVZ7Vfrzgo", "proofs": [ "4ewsFieRowsmvwKLPTMP5eCqRAapCQvGyMD9LRNPvdC13grQNfwr1ic8kcjJvAc3ZN4WAGG2ApcWNvwdhoLgE7NM" ], "script": "base64:AgQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAACZHQFAAAAByRtYXRjaDADCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCQAEEwAAAAIIBQAAAAJkdAAAAARkYXRhAgAAAAR0eXBlCQAAAgAAAAECAAAAH2R0eCBmYWlsIC0gZHR4IHR5cGUgbm90IGRlZmluZWQDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCQAEEwAAAAIIBQAAAAJkdAAAAARkYXRhAgAAAAZnYW1lSWQJAAACAAAAAQIAAAAeZHR4IGZhaWwgLSBnYW1lIGlkIG5vdCBkZWZpbmVkBAAAAAR0eXBlCQEAAAAHZXh0cmFjdAAAAAEJAAQTAAAAAggFAAAAAmR0AAAABGRhdGECAAAABHR5cGUEAAAABmdhbWVJZAkBAAAAB2V4dHJhY3QAAAABCQAEEwAAAAIIBQAAAAJkdAAAAARkYXRhAgAAAAZnYW1lSWQEAAAADHNlcnZlclNpZ25lZAkAAfQAAAADCAUAAAACZHQAA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AAGRAAAAAggFAAAAAnN0AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQcsv9n6", "chainId": 84, "height": 541916, "spentComplexity": 0 } View: original | compacted Prev: 5CaLUa74ahREByy9m69v3S3i1gsJKHehqX56eLGxxwrE Next: CnWUJ27ptC1K6uyGhnPLCUBhhh2jX625rNz9sD9ZM2A2 Diff:
OldNewDifferences
8484 }
8585 else if ((type == "payout"))
8686 then if (!(isDefined(getString(tx.sender, (gameId + "_winner")))))
87- then throw("dtx:payout fail - game winner not defined")
87+ then throw(("dtx:payout fail - game winner not defined " + toBase58String(tx.sender.bytes)))
8888 else {
8989 let winnerPk = extract(getString(tx.sender, (gameId + "_winner")))
9090 let winnerSigned = sigVerify(dt.bodyBytes, dt.proofs[0], fromBase58String(winnerPk))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 2 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 match tx {
44 case dt: DataTransaction =>
55 if (!(isDefined(getString(dt.data, "type"))))
66 then throw("dtx fail - dtx type not defined")
77 else if (!(isDefined(getString(dt.data, "gameId"))))
88 then throw("dtx fail - game id not defined")
99 else {
1010 let type = extract(getString(dt.data, "type"))
1111 let gameId = extract(getString(dt.data, "gameId"))
1212 let serverSigned = sigVerify(dt.bodyBytes, dt.proofs[0], tx.senderPublicKey)
1313 if ((type == "start"))
1414 then {
1515 let betAmount = extract(getInteger(dt.data, (gameId + "_amount")))
1616 let player1 = extract(getString(dt.data, (gameId + "_player1")))
1717 let player1TxId = extract(getString(dt.data, (gameId + "_tx1")))
1818 let player2 = extract(getString(dt.data, (gameId + "_player2")))
1919 let player2TxId = extract(getString(dt.data, (gameId + "_tx2")))
2020 let dtStartDataDefined = if (if (if (isDefined(getInteger(dt.data, (gameId + "_winAmount"))))
2121 then isDefined(getBinary(dt.data, (gameId + "_squadronHash")))
2222 else false)
2323 then isDefined(getBoolean(dt.data, ("used_tx_" + player1TxId)))
2424 else false)
2525 then isDefined(getBoolean(dt.data, ("used_tx_" + player2TxId)))
2626 else false
2727 let player1Tx = transactionById(fromBase58String(player1TxId))
2828 let player2Tx = transactionById(fromBase58String(player2TxId))
2929 let tr1Ok = match player1Tx {
3030 case t: TransferTransaction =>
3131 if (if (if (if ((t.amount == betAmount))
3232 then !(isDefined(getString(tx.sender, ("used_tx_" + player1TxId))))
3333 else false)
3434 then !(isDefined(t.assetId))
3535 else false)
3636 then (extract(getString(dt.data, ("game_" + toBase58String(addressFromPublicKey(fromBase58String(player1)).bytes)))) == gameId)
3737 else false)
3838 then (t.recipient == tx.sender)
3939 else false
4040 case _ =>
4141 false
4242 }
4343 let tr2Ok = match player2Tx {
4444 case t: TransferTransaction =>
4545 if (if (if (if ((t.amount == betAmount))
4646 then !(isDefined(getString(tx.sender, ("used_tx_" + player2TxId))))
4747 else false)
4848 then !(isDefined(t.assetId))
4949 else false)
5050 then (extract(getString(dt.data, ("game_" + toBase58String(addressFromPublicKey(fromBase58String(player2)).bytes)))) == gameId)
5151 else false)
5252 then (t.recipient == tx.sender)
5353 else false
5454 case _ =>
5555 false
5656 }
5757 if (!(serverSigned))
5858 then throw("dtx:start fail - server did not sign tx")
5959 else if (!(tr1Ok))
6060 then throw("dtx:start fail - player 1 ttx is invalid")
6161 else if (!(tr2Ok))
6262 then throw("dtx:start fail - player 2 ttx is invalid")
6363 else if (!(dtStartDataDefined))
6464 then throw("dtx:start fail - start data is incomplete")
6565 else true
6666 }
6767 else if ((type == "finish"))
6868 then {
6969 let winner = extract(getString(dt.data, (gameId + "_winner")))
7070 let correctWinner = if ((winner == extract(getString(tx.sender, (gameId + "_player1")))))
7171 then true
7272 else (winner == extract(getString(tx.sender, (gameId + "_player2"))))
7373 let squadron1 = extract(getBinary(dt.data, (gameId + "_squadron1")))
7474 let squadron2 = extract(getBinary(dt.data, (gameId + "_squadron2")))
7575 let gameSalt = extract(getBinary(dt.data, (gameId + "_salt")))
7676 let correctSquadrons = (sha256(((squadron1 + squadron2) + gameSalt)) == extract(getBinary(tx.sender, (gameId + "_squadronHash"))))
7777 if (!(serverSigned))
7878 then throw("dtx:finish fail - server did not sign tx")
7979 else if (!(correctWinner))
8080 then throw("dtx:finish fail - winner is incorrect")
8181 else if (!(correctSquadrons))
8282 then throw("dtx:finish fail - squadrons are incorrect")
8383 else true
8484 }
8585 else if ((type == "payout"))
8686 then if (!(isDefined(getString(tx.sender, (gameId + "_winner")))))
87- then throw("dtx:payout fail - game winner not defined")
87+ then throw(("dtx:payout fail - game winner not defined " + toBase58String(tx.sender.bytes)))
8888 else {
8989 let winnerPk = extract(getString(tx.sender, (gameId + "_winner")))
9090 let winnerSigned = sigVerify(dt.bodyBytes, dt.proofs[0], fromBase58String(winnerPk))
9191 let hashPkNotInState = !(isDefined(getBoolean(tx.sender, ((gameId + "_") + winnerPk))))
9292 let hashPkInData = isDefined(getBoolean(dt.data, ((gameId + "_") + winnerPk)))
9393 let ttxIdNotInState = !(isDefined(getBoolean(tx.sender, dt.data[3].key)))
9494 let data4 = (size(dt.data) == 4)
9595 if (!(winnerSigned))
9696 then throw("dtx:payout fail - winner did not sign tx")
9797 else if (!(hashPkNotInState))
9898 then throw("dtx:payout fail - payout dtx already sent")
9999 else if (!(hashPkInData))
100100 then throw("dtx:payout fail - payout (gameId, winnerPk) pair is not set")
101101 else if (!(ttxIdNotInState))
102102 then throw("dtx:payout fail - payout ttx id is not set")
103103 else if (!(data4))
104104 then throw("dtx:payout fail - data size is invalid")
105105 else true
106106 }
107107 else throw(("dtx:type_unknown " + type))
108108 }
109109 case tt: TransferTransaction =>
110110 let serverSigned = sigVerify(tt.bodyBytes, tt.proofs[0], tx.senderPublicKey)
111111 if (serverSigned)
112112 then true
113113 else {
114114 let recipientAddr = toBase58String(addressFromRecipient(tt.recipient).bytes)
115115 let gameId = extract(getString(tx.sender, ("game_" + recipientAddr)))
116116 let winner = extract(getString(tx.sender, (gameId + "_winner")))
117117 let winnerAddr = toBase58String(addressFromPublicKey(fromBase58String(winner)).bytes)
118118 let winAmount = extract(getInteger(tx.sender, (gameId + "_winAmount")))
119119 if ((recipientAddr != winnerAddr))
120120 then throw("ttx:fail - recipient is not winner")
121121 else if (!(isDefined(getBoolean(tx.sender, toBase58String(tt.id)))))
122122 then throw("ttx:fail - payout ttx not registered")
123123 else if (isDefined(tt.assetId))
124124 then throw("ttx:fail - asset id is set (not waves)")
125125 else if ((tt.amount != winAmount))
126126 then throw("ttx:fail - wrong payout amount")
127127 else true
128128 }
129129 case st: SetScriptTransaction =>
130130 sigVerify(st.bodyBytes, st.proofs[0], tx.senderPublicKey)
131131 case _ =>
132132 false
133133 }

github/deemru/w8io/026f985 
35.51 ms