tx · 44UC9kW1cfTXWSo4ZrcK7CCzdyFoWzJUcRwi6N2jjL6W 3MvhMJ5ruXxcoGywH2oMxBpzke2cxfbiH6f: -0.01000000 Waves 2018.12.15 23:46 [406402] smart account 3MvhMJ5ruXxcoGywH2oMxBpzke2cxfbiH6f > SELF 0.00000000 Waves
{ "type": 13, "id": "44UC9kW1cfTXWSo4ZrcK7CCzdyFoWzJUcRwi6N2jjL6W", "fee": 1000000, "feeAssetId": null, "timestamp": 1544906856916, "version": 1, "sender": "3MvhMJ5ruXxcoGywH2oMxBpzke2cxfbiH6f", "senderPublicKey": "DHcTiSbT6T8QxynsPx7dXbeuNmadfrA3RPJFCpBxe16i", "proofs": [ "4xwk2LMu9eeUDV651TbZwx414zLaxGojwz9hsyCGNqoZogFP3DAfouaaEzqXE52KZxrbayLh9oGusxmcC3yVUYn9" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAAB2NyZWF0b3IJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNOM0hhb3pTNFVnVWtGR2pjZEo5YldtQlBjaURYckF2N3BMBAAAAApzZWNyZXRIYXNoAQAAACABJfCCTC/lt6WX/Pa36zLeNBAcdnUDQ4Xa8R6THWbDtwQAAAAEd2F2ZQAAAAAABfXhAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEJAAQcAAAAAgUAAAACbWUCAAAAB3BheW1lbnQEAAAACXBheW1lbnRUeAkAA+gAAAABCQEAAAAHZXh0cmFjdAAAAAEJAAQSAAAAAggFAAAAAXQAAAAEZGF0YQIAAAAHcGF5bWVudAQAAAAOaXNQYXltZW50VmFsaWQEAAAAByRtYXRjaDEFAAAACXBheW1lbnRUeAMJAAABAAAAAgUAAAAHJG1hdGNoMQIA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hbGlkCQAAAAAAAAIIBQAAAAZwYXlvdXQAAAAJcmVjaXBpZW50BQAAAAZ3aW5uZXIHBxyYyrU=", "chainId": 84, "height": 406402, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 1 #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let me = tx.sender | |
4 | + | let creator = addressFromString("3N3HaozS4UgUkFGjcdJ9bWmBPciDXrAv7pL") | |
5 | + | let secretHash = base58'5UxmjWzek8PJrQDQzEi7NFtnA7vD4un2NrMoSWtvVDx' | |
6 | + | let wave = 100000000 | |
7 | + | match tx { | |
8 | + | case t: DataTransaction => | |
9 | + | if (!(isDefined(getBinary(me, "payment")))) | |
10 | + | then { | |
11 | + | let paymentTx = transactionById(extract(getBinary(t.data, "payment"))) | |
12 | + | let isPaymentValid = match paymentTx { | |
13 | + | case p: TransferTransaction => | |
14 | + | if (if ((p.amount == (1 * wave))) | |
15 | + | then (p.recipient == me) | |
16 | + | else false) | |
17 | + | then sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey) | |
18 | + | else false | |
19 | + | case _ => | |
20 | + | false | |
21 | + | } | |
22 | + | let guess = extract(getBinary(t.data, "guess")) | |
23 | + | if (isPaymentValid) | |
24 | + | then guess | |
25 | + | else false | |
26 | + | } | |
27 | + | else false | |
28 | + | case payout: TransferTransaction => | |
29 | + | let secret = take(payout.proofs[0], 1) | |
30 | + | let isValid = (blake2b256(payout.proofs[0]) == secretHash) | |
31 | + | let winner = if ((secret == extract(getBinary(me, "guess")))) | |
32 | + | then creator | |
33 | + | else match transactionById(extract(getBinary(me, "payment"))) { | |
34 | + | case p1: TransferTransaction => | |
35 | + | p1.sender | |
36 | + | case _ => | |
37 | + | addressFromString("") | |
38 | + | } | |
39 | + | if (isValid) | |
40 | + | then (payout.recipient == winner) | |
41 | + | else false | |
42 | + | case _ => | |
43 | + | false | |
44 | + | } |
github/deemru/w8io/169f3d6 63.92 ms ◑