tx · aZhCzZC529oisTj8FwxnEqa6t7bNAznHmA4jXBYEWhH 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub: -0.01000000 Waves 2019.01.31 20:02 [474708] smart account 3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub > SELF 0.00000000 Waves
{ "type": 13, "id": "aZhCzZC529oisTj8FwxnEqa6t7bNAznHmA4jXBYEWhH", "fee": 1000000, "feeAssetId": null, "timestamp": 1548954168554, "version": 1, "sender": "3N7UYW9TnmvBHnFst9imprHsoAMHQ3NR7Ub", "senderPublicKey": "CXpiWubcdkB79QekRVaEXMVY8N12qP2f9zJp5sziGfge", "proofs": [ "czPoLnK9tohexcPHJQ8mFGtWqGXnEy1CgSzcy4Tfyssnt8bZAF3gYr1DrQ6YCYDNkVvXrYVQQVFoVZd171FsmS2" ], "script": "base64:AQQAAAAIdm90ZUJhbmsJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEJAAJZAAAAAQIAAAAABAAAABNtaW5pbWFsVm90aW5nSGVpZ2h0AAAAAAAAAABkBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwAwkAAAAAAAACCQABkAAAAAEIBQAAAAFkAAAABGRhdGEAAAAAAAAAAAIEAAAADWZlZVRyYW5zZmVySWQJAAPoAAAAAQkAAZEAAAACCAUAAAABZAAAAAZwcm9vZnMAAAAAAAAAAAAEAAAAByRtYXRjaDEFAAAADWZlZVRyYW5zZmVySWQDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAmZUBQAAAAckbWF0Y2gxBAAAAAx2b3RpbmdIZWlnaHQJAQAAAAdleHRyYWN0AAAAAQkBAAAACmdldEludGVnZXIAAAACCAUAAAABZAAAAARkYXRhAAAAAAAAAAABAwMDAwkBAAAAASEAAAABCQEAAA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3MGCQAAAAAAAAIJAAQkAAAAAQgFAAAAAXQAAAAJcmVjaXBpZW50CQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABCQEAAAAHZXh0cmFjdAAAAAEJAAQdAAAAAgUAAAAIdm90ZUJhbmsCAAAABGNvbnMHCQEAAAAJaXNEZWZpbmVkAAAAAQkABB0AAAACBQAAAAh2b3RlQmFuawIAAAAEcHJvcwcJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAACHZvdGVCYW5rAgAAAARjb25zBwkAAAIAAAABAgAAADN5b3UgY2Fubm90IHZvdGUgd2l0aCB0aGlzIHRva2VuLiBJdCdzIG5vdCByZWdpc3RyZWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFzBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQc/abHv", "chainId": 84, "height": 474708, "spentComplexity": 0 } View: original | compacted Prev: none Next: 6a8RKre3axoVQ5xUHy9SDQWDMzLeYk6WgmjAA3JeQx9K Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 1 #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let voteBank = addressFromPublicKey(fromBase58String("")) | |
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, 1)) | |
13 | + | if (if (if (if (!(isDefined(getString(voteBank, d.data[0].key)))) | |
14 | + | then (fT.recipient == voteBank) | |
15 | + | else false) | |
16 | + | then (votingHeight > height) | |
17 | + | else false) | |
18 | + | then ((votingHeight - height) > minimalVotingHeight) | |
19 | + | else false) | |
20 | + | then match transactionById(fromBase58String(d.data[0].key)) { | |
21 | + | case i: IssueTransaction => | |
22 | + | let accountScriptedProof = extract(getBinary(d.data, 1)) | |
23 | + | let accountScriptHash = extract(getBinary(voteBank, "IssuerAccountScriptHash")) | |
24 | + | let scriptTx = transactionById(accountScriptedProof) | |
25 | + | if ((fT.amount >= (i.quantity * 900000))) | |
26 | + | then if (if (if ( match scriptTx { | |
27 | + | case s: SetScriptTransaction => | |
28 | + | (sha256(extract(s.script)) == accountScriptHash) | |
29 | + | case _ => | |
30 | + | throw("voting initiator not scripted, or script is wrong") | |
31 | + | }) | |
32 | + | then (i.decimals == 0) | |
33 | + | else false) | |
34 | + | then (fT.senderPublicKey == i.senderPublicKey) | |
35 | + | else false) | |
36 | + | then sigVerify(d.bodyBytes, d.proofs[1], fT.senderPublicKey) | |
37 | + | else false | |
38 | + | else throw(("minimum trasfer transaction amount is" + toString((i.quantity * 900000)))) | |
39 | + | case _ => | |
40 | + | false | |
41 | + | } | |
42 | + | else false | |
43 | + | case _ => | |
44 | + | false | |
45 | + | } | |
46 | + | } | |
47 | + | else throw("data tx should contain only one key-value pair: assetId-maxVotingHeight") | |
48 | + | case t: TransferTransaction => | |
49 | + | if (isDefined(getInteger(voteBank, toBase58String(extract(t.assetId))))) | |
50 | + | then { | |
51 | + | let h = getInteger(voteBank, toBase58String(extract(t.assetId))) | |
52 | + | if (if (if ((height >= extract(h))) | |
53 | + | then if ((addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "pros"))))) | |
54 | + | then true | |
55 | + | else (addressFromRecipient(t.recipient) == addressFromString(extract(getString(voteBank, "cons")))) | |
56 | + | else false) | |
57 | + | then isDefined(getString(voteBank, "pros")) | |
58 | + | else false) | |
59 | + | then isDefined(getString(voteBank, "cons")) | |
60 | + | else false | |
61 | + | } | |
62 | + | else throw("you cannot vote with this token. It's not registred") | |
63 | + | case s: SetScriptTransaction => | |
64 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
65 | + | case _ => | |
66 | + | false | |
67 | + | } |
github/deemru/w8io/169f3d6 29.15 ms ◑