tx · Hqx9yLj9h2D7wq3ZPzwAKQxqJwtGYDSTu4yeybTmJyZX 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub: -0.01000000 Waves 2019.02.03 18:41 [479002] smart account 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub > SELF 0.00000000 Waves
{ "type": 13, "id": "Hqx9yLj9h2D7wq3ZPzwAKQxqJwtGYDSTu4yeybTmJyZX", "fee": 1000000, "feeAssetId": null, "timestamp": 1549208513646, "version": 1, "sender": "3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub", "senderPublicKey": "CXpiWubcdkB79QekRVaEXMVY8N12qP2f9zJp5sziGfge", "proofs": [ "yXXXLaXK171p3t9jaAGAJoNTgPSEMfsgaMSr845o4coJxS4PpLG9F6rUzd2Ackz8Pov6UfTpt237uSdbGssKeuV" ], "script": "base64:AQQAAAAIdm90ZUJhbmsIBQAAAAJ0eAAAAAZzZW5kZXIEAAAAE21pbmltYWxWb3RpbmdIZWlnaHQAAAAAAAAAAGQEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDADCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWQAAAAEZGF0YQAAAAAAAAAAAwQAAAANZmVlVHJhbnNmZXJJZAkAA+gAAAABCQABkQAAAAIIBQAAAAFkAAAABnByb29mcwAAAAAAAAAAAAQAAAAHJG1hdGNoMQUAAAANZmVlVHJhbnNmZXJJZAMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACZlQFAAAAByRtYXRjaDEEAAAADHZvdGluZ0hlaWdodAkBAAAAB2V4dHJhY3QAAAABCQEAAAAKZ2V0SW50ZWdlcgAAAAIIBQAAAAFkAAAABGRhdGEAAAAAAAAAAAADAwMDAwMJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAA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9zBwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAIdm90ZUJhbmsCAAAABGNvbnMHCQAAAgAAAAECAAAAM3lvdSBjYW5ub3Qgdm90ZSB3aXRoIHRoaXMgdG9rZW4uIEl0J3Mgbm90IHJlZ2lzdHJlZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXMFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B18mEXo=", "chainId": 84, "height": 479002, "spentComplexity": 0 } View: original | compacted Prev: 2rusFoyuTiaBBiTT5Fh79tqKKu1uAFU6sEm8WcQ737cK Next: AKJLHKozV1c3eELQtaqF4pbQm1ZQhyEYmztjFBuitEzy Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
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") | |
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 | + | } |
github/deemru/w8io/026f985 32.28 ms ◑