tx · 4Jy9anTBvqzk1Wy2kVhtyM4jRodSard6m9tpRAh3UKkX

3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub:  -0.01400000 Waves

2019.02.02 23:11 [477841] smart account 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub > SELF 0.00000000 Waves

{ "type": 13, "id": "4Jy9anTBvqzk1Wy2kVhtyM4jRodSard6m9tpRAh3UKkX", "fee": 1400000, "feeAssetId": null, "timestamp": 1549138315856, "version": 1, "sender": "3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub", "senderPublicKey": "CXpiWubcdkB79QekRVaEXMVY8N12qP2f9zJp5sziGfge", "proofs": [ "4gQea6xGbN7Q1afmYMGsQVeoGUNhY6MvLJhrj6Ee1DQk3PtZfyyR2kSoPkVW5rEoQnzpn6TauYin3dm8MqNMqx2p" ], "script": null, "chainId": 84, "height": 477841, "spentComplexity": 0 } View: original | compacted Prev: EBssfXv9mrLKDnB49en9SjqzkRHK5DnFGDDVU8kTRgUp Next: DEhW2EsUfkJ47Vz6B8iSpaWC4kzR7BbUMzdf6fCNC6uU 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 if (if (if (if (if ( match scriptTx {
29- case s: SetScriptTransaction =>
30- (sha256(extract(s.script)) == accountScriptHash)
31- case _ =>
32- throw("voting initiator not scripted, or script is wrong")
33- })
34- then (i.decimals == 0)
35- else false)
36- then (fT.senderPublicKey == i.senderPublicKey)
37- else false)
38- then (d.data[1].key == toBase58String(i.sender.bytes))
39- else false)
40- then (fromBase58String(d.data[0].key) == fT.attachment)
41- else false)
42- then sigVerify(d.bodyBytes, d.proofs[1], fT.senderPublicKey)
43- else false
44- else throw(("minimum trasfer transaction amount is" + toString((i.quantity * 900000))))
45- case _ =>
46- throw("data key at 0 index should contain voting asset id")
47- }
48- else false
49- case _ =>
50- throw("proof at index 0 doesn't contain fee transfer transaction")
51- }
52- }
53- else throw("data tx should contain two key-value pairs: 0 - assetId-maxVotingHeight, 1 - ")
54- case t: TransferTransaction =>
55- if (isDefined(getInteger(voteBank, toBase58String(extract(t.assetId)))))
56- then {
57- let h = getInteger(voteBank, toBase58String(extract(t.assetId)))
58- if (if (if ((height >= extract(h)))
59- then if ((addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "pros")))))
60- then true
61- else (addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "cons"))))
62- else false)
63- then isDefined(getString(voteBank, "pros"))
64- else false)
65- then isDefined(getString(voteBank, "cons"))
66- else false
67- }
68- else throw("you cannot vote with this token. It's not registred")
69- case s: SetScriptTransaction =>
70- sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
71- case _ =>
72- false
73-}
1+# no script

github/deemru/w8io/3ef1775 
41.81 ms