tx · svTePnfd7uu6cKhunRxuzk4bSuBUq6ZD8gXz1ZKFPDj

3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub:  -0.01400000 Waves

2019.02.03 19:27 [479049] smart account 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub > SELF 0.00000000 Waves

{ "type": 13, "id": "svTePnfd7uu6cKhunRxuzk4bSuBUq6ZD8gXz1ZKFPDj", "fee": 1400000, "feeAssetId": null, "timestamp": 1549211307516, "version": 1, "sender": "3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub", "senderPublicKey": "CXpiWubcdkB79QekRVaEXMVY8N12qP2f9zJp5sziGfge", "proofs": [ "5efX6r1NS7PLzznVJQ3wD98dQRxjwPSM3uuB2xZnKvovbYamSopuu2xmC7kifU8s9RiABg1ikxQ93a28bq395mVf" ], "script": "base64:AQQAAAAIdm90ZUJhbmsIBQAAAAJ0eAAAAAZzZW5kZXIEAAAAE21pbmltYWxWb3RpbmdIZWlnaHQAAAAAAAAAAGQEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDADCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWQAAAAEZGF0YQAAAAAAAAAAAwQAAAANZmVlVHJhbnNmZXJJZAkAA+gAAAABCQABkQAAAAIIBQAAAAFkAAAABnByb29mcwAAAAAAAAAAAAQAAAAHJG1hdGNoMQUAAAANZmVlVHJhbnNmZXJJZAMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACZlQFAAAAByRtYXRjaDEEAAAADHZvdGluZ0hlaWdodAkBAAAAB2V4dHJhY3QAAAABCQEAAAAKZ2V0SW50ZWdlcgAAAAIIBQAAAAFkAAAABGRhdGEAAAAAAAAAAAADAwMDAwMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEJAA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zRnJvbVN0cmluZwAAAAEJAQAAAAdleHRyYWN0AAAAAQkABB0AAAACBQAAAAh2b3RlQmFuawIAAAAEcHJvcwYJAAAAAAAAAgkABCQAAAABCAUAAAABdAAAAAlyZWNpcGllbnQJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAEJAQAAAAdleHRyYWN0AAAAAQkABB0AAAACBQAAAAh2b3RlQmFuawIAAAAEY29ucwcJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAACHZvdGVCYW5rAgAAAARwcm9zBwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAIdm90ZUJhbmsCAAAABGNvbnMHCQAAAgAAAAECAAAAM3lvdSBjYW5ub3Qgdm90ZSB3aXRoIHRoaXMgdG9rZW4uIEl0J3Mgbm90IHJlZ2lzdHJlZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXMFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B+luyaE=", "chainId": 84, "height": 479049, "spentComplexity": 0 } View: original | compacted Prev: AKJLHKozV1c3eELQtaqF4pbQm1ZQhyEYmztjFBuitEzy Next: AgwjSb2qd4yhLSQUTLwj7P7UvKoDmH5ZpRfabYR9dnry Diff:
OldNewDifferences
3131 let accountScriptHash = extract(getBinary(voteBank, "IssuerAccountScriptHash"))
3232 let scriptTx = transactionById(accountScriptedProof)
3333 if ((fT.amount >= (i.quantity * 900000)))
34- then if (if (if (if (if (if ( match scriptTx {
34+ then if (if (if (if (if (if (if ( match scriptTx {
3535 case s: SetScriptTransaction =>
3636 if ((sha256(extract(s.script)) == accountScriptHash))
3737 then true
5151 then true
5252 else throw("trying to reg asset of another issuer")
5353 else false)
54- then (fromBase58String(d.data[0].key) == extract(fT.attachment))
54+ then if (!(isDefined(getBinary(voteBank, toBase58String(sha256(i.description))))))
55+ then true
56+ else throw("voting question already registred")
57+ else false)
58+ then (fromBase58String(d.data[0].key) == fT.attachment)
5559 else false)
5660 then if (sigVerify(d.bodyBytes, d.proofs[1], fT.senderPublicKey))
5761 then true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 1 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 let voteBank = tx.sender
44 let minimalVotingHeight = 100
55 match tx {
66 case d: DataTransaction =>
77 if ((size(d.data) == 3))
88 then {
99 let feeTransferId = transactionById(d.proofs[0])
1010 match feeTransferId {
1111 case fT: TransferTransaction =>
1212 let votingHeight = extract(getInteger(d.data, 0))
1313 if (if (if (if (if (if (!(isDefined(getInteger(voteBank, d.data[0].key))))
1414 then true
1515 else throw("asset already registred"))
1616 then if ((fT.recipient == voteBank))
1717 then true
1818 else throw("fee recipient not votebank")
1919 else false)
2020 then !(isDefined(fT.assetId))
2121 else false)
2222 then (votingHeight > height)
2323 else false)
2424 then if (((votingHeight - height) >= minimalVotingHeight))
2525 then true
2626 else throw("voting interval should be more than 100 blocks")
2727 else false)
2828 then match transactionById(fromBase58String(d.data[0].key)) {
2929 case i: IssueTransaction =>
3030 let accountScriptedProof = extract(getBinary(d.data, 1))
3131 let accountScriptHash = extract(getBinary(voteBank, "IssuerAccountScriptHash"))
3232 let scriptTx = transactionById(accountScriptedProof)
3333 if ((fT.amount >= (i.quantity * 900000)))
34- then if (if (if (if (if (if ( match scriptTx {
34+ then if (if (if (if (if (if (if ( match scriptTx {
3535 case s: SetScriptTransaction =>
3636 if ((sha256(extract(s.script)) == accountScriptHash))
3737 then true
3838 else throw("script hash not fit requirements")
3939 case _ =>
4040 throw("voting initiator not scripted, or script is wrong")
4141 })
4242 then (i.decimals == 0)
4343 else false)
4444 then (fT.senderPublicKey == i.senderPublicKey)
4545 else false)
4646 then if ((getBinary(d.data, 2) == i.id))
4747 then true
4848 else throw("voting question should be registred with question")
4949 else false)
5050 then if ((d.data[1].key == toBase58String(i.sender.bytes)))
5151 then true
5252 else throw("trying to reg asset of another issuer")
5353 else false)
54- then (fromBase58String(d.data[0].key) == extract(fT.attachment))
54+ then if (!(isDefined(getBinary(voteBank, toBase58String(sha256(i.description))))))
55+ then true
56+ else throw("voting question already registred")
57+ else false)
58+ then (fromBase58String(d.data[0].key) == fT.attachment)
5559 else false)
5660 then if (sigVerify(d.bodyBytes, d.proofs[1], fT.senderPublicKey))
5761 then true
5862 else throw("wrong signature")
5963 else false
6064 else throw(("minimum trasfer transaction amount is" + toString((i.quantity * 900000))))
6165 case _ =>
6266 throw("data key at 0 index should contain voting asset id")
6367 }
6468 else false
6569 case _ =>
6670 throw("proof at index 0 doesn't contain fee transfer transaction")
6771 }
6872 }
6973 else throw("data tx should contain two key-value pairs: 0 - assetId-maxVotingHeight, 1 - ")
7074 case t: TransferTransaction =>
7175 if (isDefined(getInteger(voteBank, toBase58String(extract(t.assetId)))))
7276 then {
7377 let h = getInteger(voteBank, toBase58String(extract(t.assetId)))
7478 if (if (if ((extract(h) > height))
7579 then if ((addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "pros")))))
7680 then true
7781 else (addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "cons"))))
7882 else false)
7983 then isDefined(getString(voteBank, "pros"))
8084 else false)
8185 then isDefined(getString(voteBank, "cons"))
8286 else false
8387 }
8488 else throw("you cannot vote with this token. It's not registred")
8589 case s: SetScriptTransaction =>
8690 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
8791 case _ =>
8892 false
8993 }

github/deemru/w8io/026f985 
39.33 ms