tx · 2rusFoyuTiaBBiTT5Fh79tqKKu1uAFU6sEm8WcQ737cK

3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub:  -0.01400000 Waves

2019.02.03 18:40 [479000] smart account 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub > SELF 0.00000000 Waves

{ "type": 13, "id": "2rusFoyuTiaBBiTT5Fh79tqKKu1uAFU6sEm8WcQ737cK", "fee": 1400000, "feeAssetId": null, "timestamp": 1549208431319, "version": 1, "sender": "3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub", "senderPublicKey": "CXpiWubcdkB79QekRVaEXMVY8N12qP2f9zJp5sziGfge", "proofs": [ "3uFcBPCxvvt8132vcLZKSb8xTA6PuHsLxwoqMN5tKkog5sQ6LJqGMfUXVKyLDzyoiaM8FVJe54hZpjyYcShE9m1C" ], "script": null, "chainId": 84, "height": 479000, "spentComplexity": 0 } View: original | compacted Prev: CQhCipCb7436jsMpZ1AEKEFNa7mWM2YMuBcdwTLRR34 Next: Hqx9yLj9h2D7wq3ZPzwAKQxqJwtGYDSTu4yeybTmJyZX 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) == 3))
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 (if (!(isDefined(getInteger(voteBank, d.data[0].key))))
14- then true
15- else throw("asset already registred"))
16- then if ((fT.recipient == voteBank))
17- then true
18- else throw("fee recipient not votebank")
19- else false)
20- then !(isDefined(fT.assetId))
21- else false)
22- then (votingHeight > height)
23- else false)
24- then if (((votingHeight - height) >= minimalVotingHeight))
25- then true
26- else throw("voting interval should be more than 100 blocks")
27- else false)
28- then match transactionById(fromBase58String(d.data[0].key)) {
29- case i: IssueTransaction =>
30- let accountScriptedProof = extract(getBinary(d.data, 1))
31- let accountScriptHash = extract(getBinary(voteBank, "IssuerAccountScriptHash"))
32- let scriptTx = transactionById(accountScriptedProof)
33- if ((fT.amount >= (i.quantity * 900000)))
34- then if (if (if (if (if ( match scriptTx {
35- case s: SetScriptTransaction =>
36- if ((sha256(extract(s.script)) == accountScriptHash))
37- then true
38- else throw(("script hash not fit requirements" + toBase58String(sha256(extract(s.script)))))
39- case _ =>
40- throw("voting initiator not scripted, or script is wrong")
41- })
42- then (i.decimals == 0)
43- else false)
44- then (fT.senderPublicKey == i.senderPublicKey)
45- else false)
46- then if ((getBinary(d.data, 2) == i.id))
47- then true
48- else throw("voting question should be registred with question")
49- else false)
50- then if ((d.data[1].key == toBase58String(i.sender.bytes)))
51- then true
52- else throw("trying to reg asset of another issuer")
53- else false)
54- then if (sigVerify(d.bodyBytes, d.proofs[1], fT.senderPublicKey))
55- then true
56- else throw("wrong signature")
57- else false
58- else throw(("minimum trasfer transaction amount is" + toString((i.quantity * 900000))))
59- case _ =>
60- throw("data key at 0 index should contain voting asset id")
61- }
62- else false
63- case _ =>
64- throw("proof at index 0 doesn't contain fee transfer transaction")
65- }
66- }
67- else throw("data tx should contain two key-value pairs: 0 - assetId-maxVotingHeight, 1 - ")
68- case t: TransferTransaction =>
69- if (isDefined(getInteger(voteBank, toBase58String(extract(t.assetId)))))
70- then {
71- let h = getInteger(voteBank, toBase58String(extract(t.assetId)))
72- if (if (if ((extract(h) > height))
73- then if ((addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "pros")))))
74- then true
75- else (addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "cons"))))
76- else false)
77- then isDefined(getString(voteBank, "pros"))
78- else false)
79- then isDefined(getString(voteBank, "cons"))
80- else false
81- }
82- else throw("you cannot vote with this token. It's not registred")
83- case s: SetScriptTransaction =>
84- sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
85- case _ =>
86- false
87-}
1+# no script

github/deemru/w8io/3ef1775 
40.67 ms