tx · GypWH9jwEyxihQ6BEtscTtfEiNPDp8F3fLGZFZpeuTEg 3MyBkcYJtiD9AiKeF7frTa4Xja4cHa78LGv: -0.01500000 Waves 2019.08.19 11:50 [637816] smart account 3MyBkcYJtiD9AiKeF7frTa4Xja4cHa78LGv > SELF 0.00000000 Waves
{ "type": 13, "id": "GypWH9jwEyxihQ6BEtscTtfEiNPDp8F3fLGZFZpeuTEg", "fee": 1500000, "feeAssetId": null, "timestamp": 1566204621467, "version": 1, "sender": "3MyBkcYJtiD9AiKeF7frTa4Xja4cHa78LGv", "senderPublicKey": "GmMz5a1af3uZ7SBLM4ijGestdMLMYnJMPeufsksfDntF", "proofs": [ "aHgXBZ3Ya2MTg4Kd2GiFUzdsHAd5nHaGEu15ZXdGm3UbtunU9fdBAJangc65ZhctncMpB2DzEJL3wxef9cy5kGQ" ], "script": "base64:AAIDAAAAAAAAAAAAAAAGAAAAAAtWb3RlQXNzZXRJZAkAAlkAAAABAgAAACxGYUtIbVJ2RDJNWFdCc0JvRUp6cldSREpKeUhTRWMyREVlVlBhUWllN25ENgAAAAAGZmluaXNoCQAAZAAAAAIAAAAAAAAJu3cAAAAAAAAAHCAAAAAACktleVZvdGVGb3ICAAAACCR2b3RlRm9yAAAAAA5LZXlWb3RlQWdhaW5zdAIAAAAMJHZvdGVBZ2FpbnN0AQAAAAtnZXRJbnRWYWx1ZQAAAAEAAAADa2V5BAAAAAZ2YWxPcHQJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkBAAAACWlzRGVmaW5lZAAAAAEFAAAABnZhbE9wdAkBAAAAB2V4dHJhY3QAAAABBQAAAAZ2YWxPcHQJAAACAAAAAQkAASwAAAACBQAAAANrZXkCAAAALyB3YXMgbm90IGluaXRpYWxpemVkIGJlZm9yZSBjb250cmFjdCBkZXBsb3ltZW50AQAAAAR2b3RlAAAAAgAAAAd2b3RlS2V5AAAAA2ludgQAAAALY3VyclZvdGVWYWwJAQAAAAtnZXRJbnRWYWx1ZQAAAA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AAAAAWkAAAABaQEAAAALdm90ZUFnYWluc3QAAAAACQEAAAAEdm90ZQAAAAIFAAAADktleVZvdGVBZ2FpbnN0BQAAAAFpAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAcLI01V", "chainId": 84, "height": 637816, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let VoteAssetId = fromBase58String("FaKHmRvD2MXWBsBoEJzrWRDJJyHSEc2DEeVPaQie7nD6") | |
5 | + | ||
6 | + | let finish = (637815 + 7200) | |
7 | + | ||
8 | + | let KeyVoteFor = "$voteFor" | |
9 | + | ||
10 | + | let KeyVoteAgainst = "$voteAgainst" | |
11 | + | ||
12 | + | func getIntValue (key) = { | |
13 | + | let valOpt = getInteger(this, key) | |
14 | + | if (isDefined(valOpt)) | |
15 | + | then extract(valOpt) | |
16 | + | else throw((key + " was not initialized before contract deployment")) | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func vote (voteKey,inv) = { | |
21 | + | let currVoteVal = getIntValue(voteKey) | |
22 | + | let callerBalance = assetBalance(inv.caller, VoteAssetId) | |
23 | + | let pmt = if (isDefined(inv.payment)) | |
24 | + | then extract(inv.payment) | |
25 | + | else throw("Impossible to Vote without attached payment") | |
26 | + | let pmtAssetId = if (isDefined(pmt.assetId)) | |
27 | + | then extract(pmt.assetId) | |
28 | + | else throw("Impossible to use WAVES for Voting") | |
29 | + | if ((height > finish)) | |
30 | + | then throw("Voting finished") | |
31 | + | else if ((pmtAssetId != VoteAssetId)) | |
32 | + | then throw((("Impossible to use " + toBase58String(pmtAssetId)) + " for voting")) | |
33 | + | else if ((callerBalance != pmt.amount)) | |
34 | + | then throw("All Voting token from balance must be attached") | |
35 | + | else WriteSet([DataEntry(voteKey, (currVoteVal + pmt.amount))]) | |
36 | + | } | |
37 | + | ||
38 | + | ||
39 | + | @Callable(i) | |
40 | + | func voteFor () = vote(KeyVoteFor, i) | |
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | @Callable(i) | |
45 | + | func voteAgainst () = vote(KeyVoteAgainst, i) | |
46 | + | ||
47 | + | ||
48 | + | @Verifier(tx) | |
49 | + | func verify () = false | |
50 | + |
github/deemru/w8io/026f985 13.90 ms ◑