tx · zWK3iYenwktBpWh9UeSs7pFHzuEqicUDJ2ZHAdvrZoE

3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub:  -0.01400000 Waves

2019.02.02 02:29 [476583] smart account 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub > SELF 0.00000000 Waves

{ "type": 13, "id": "zWK3iYenwktBpWh9UeSs7pFHzuEqicUDJ2ZHAdvrZoE", "fee": 1400000, "feeAssetId": null, "timestamp": 1549063838274, "version": 1, "sender": "3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub", "senderPublicKey": "CXpiWubcdkB79QekRVaEXMVY8N12qP2f9zJp5sziGfge", "proofs": [ "2maXsLpiNFcwwgiwSLDg5oed7N4Kq58Vxmyd6jVB9XhGsZBvWmmdwEfrPzRAYtGUE8DCJLKxAgymhL38X5Q4dkWt" ], "script": null, "chainId": 84, "height": 476583, "spentComplexity": 0 } View: original | compacted Prev: 54tUnG5n3AtDADkotB8KGs6R7kbqBdfLSV8cA4sT3w2u Next: 3321QSVFxX7YUopQghKRwebrdPJDL1PcEzzzanm9HAiE Full:
OldNewDifferences
1-{-# STDLIB_VERSION 1 #-}
2-{-# CONTENT_TYPE EXPRESSION #-}
3-let voteBank = tx.sender
4-let minimalVotingHeight = 100
5-match tx {
6- case d: DataTransaction =>
7- if ((size(d.data) == 2))
8- then {
9- let feeTransferId = transactionById(d.proofs[0])
10- match feeTransferId {
11- case fT: TransferTransaction =>
12- let votingHeight = extract(getInteger(d.data, 0))
13- if (if (if (if (if (!(isDefined(getString(voteBank, d.data[0].key))))
14- then (fT.recipient == voteBank)
15- else false)
16- then !(isDefined(fT.assetId))
17- else false)
18- then (votingHeight > height)
19- else false)
20- then ((votingHeight - height) >= minimalVotingHeight)
21- else false)
22- then match transactionById(fromBase58String(d.data[0].key)) {
23- case i: IssueTransaction =>
24- let accountScriptedProof = extract(getBinary(d.data, 1))
25- let accountScriptHash = extract(getBinary(voteBank, "IssuerAccountScriptHash"))
26- let scriptTx = transactionById(accountScriptedProof)
27- if ((fT.amount >= (i.quantity * 900000)))
28- then match scriptTx {
29- case s: SetScriptTransaction =>
30- if ((sha256(extract(s.script)) == accountScriptHash))
31- then true
32- else throw(((("hash should be equal to " + toBase58String(sha256(extract(s.script)))) + "actual is ") + toBase58String(accountScriptHash)))
33- case _ =>
34- throw("voting initiator not scripted, or script is wrong")
35- }
36- else throw(("minimum trasfer transaction amount is" + toString((i.quantity * 900000))))
37- case _ =>
38- throw("data key at 0 index should contain voting asset id")
39- }
40- else false
41- case _ =>
42- throw("proof at index 0 doesn't contain fee transfer transaction")
43- }
44- }
45- else throw("data tx should contain two key-value pairs: 0 - assetId-maxVotingHeight, 1 - ")
46- case t: TransferTransaction =>
47- if (isDefined(getInteger(voteBank, toBase58String(extract(t.assetId)))))
48- then {
49- let h = getInteger(voteBank, toBase58String(extract(t.assetId)))
50- if (if (if ((height >= extract(h)))
51- then if ((addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "pros")))))
52- then true
53- else (addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "cons"))))
54- else false)
55- then isDefined(getString(voteBank, "pros"))
56- else false)
57- then isDefined(getString(voteBank, "cons"))
58- else false
59- }
60- else throw("you cannot vote with this token. It's not registred")
61- case s: SetScriptTransaction =>
62- sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
63- case _ =>
64- false
65-}
1+# no script

github/deemru/w8io/3ef1775 
36.74 ms