tx · 5aKVz79kwkF67Scc6cXNkBpQbBXxpcbR6JRStuDkLwAe 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ: -0.01400000 Waves 2021.09.22 07:29 [1713776] smart account 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ > SELF 0.00000000 Waves
{ "type": 13, "id": "5aKVz79kwkF67Scc6cXNkBpQbBXxpcbR6JRStuDkLwAe", "fee": 1400000, "feeAssetId": null, "timestamp": 1632284975024, "version": 2, "chainId": 84, "sender": "3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ", "senderPublicKey": "BMLuSYJ8rvQD55waCoKpzCBhJAbY8s9pp4V5ZgxuzCBD", "proofs": [ "3QCAMcEfA1ZaeA72DatpXesRy6CYKbVCpziM3e2Ugozj9daViHA28oJtPHKw34h4NGkkajMUZHjhBmmkTNTcPDHW" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAAAgAAAAAKQTRBQXNzZXRJRAEAAAAg/sQa4d7v52kifRLo73ftXd9xD7wgh9JaaHT98W4IWDcAAAAAC1VTRFRBc3NldElEAQAAACAIZYS3D/CKahrz4mjoLgiQJMPTJ1gDzSz2Ll4L39oVpAAAAAEAAAABaQEAAAAEVm90ZQAAAAEAAAAORmF2b3VyaXRlQXNzZXQEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAADQwLjAwMDEgQTRBIFRva2VuIGlzIHJlcXVpcmVkIGFzIEF0dGFjaGVkIHBheW1lbnRbMV0uBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADldlZWswVGltZXN0YW1wAAAAAXv60OfABAAAAAhlYWNod2VlawAAAAAAJAyEAAQAAAASY3VycmVudHJ1bm5pbmd3ZWVrCQAAaQAAAAIJAABl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YJAAAAAAAAAgUAAAAORmF2b3VyaXRlQXNzZXQCAAAABVdBVkVTCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAMVm90ZWRfQXNzZXRfBQAAAApjdXJyZW50S2V5BQAAAA5GYXZvdXJpdGVBc3NldAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAdtZXNzYWdlAgAAACQ8aDE+WW91IFZvdGVkIFN1Y2Nlc3NmdWxseSE8L2gxPjxicj4JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAE0N1cnJlbnRfVm90aW5nX1dlZWsFAAAAEmN1cnJlbnRydW5uaW5nd2VlawkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOV2VlazBUaW1lc3RhbXAFAAAADldlZWswVGltZXN0YW1wCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAABJMYXN0QmxvY2tUaW1lU3RhbXAIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAADkZhdm91cml0ZUFzc2V0AgAAAAxfVG90YWxfVm90ZXMFAAAACnRvdGFsdm90ZXMJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAApBNEFBc3NldElEBQAAAANuaWwJAAACAAAAAQIAAAAlQmxhbmsvV3JvbmcgSW5wdXQgRW50ZXJlZCBGb3IgVm90aW5nLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V59M4yVQ==", "height": 1713776, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9unhYDnDCEbL1HYsnmeJFFue3PzqXBYqDregSpbLJeXS Next: 38GxLopQUMfKFjGffYWjhbQMMbh6UNCrBqnaxisf7JZa Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | then c.payments[0] | |
12 | 12 | else throw("0.0001 A4A Token is required as Attached payment[1].") | |
13 | 13 | let f = toBase58String(c.caller.bytes) | |
14 | - | let g = | |
15 | - | let h = | |
16 | - | let i = (( | |
14 | + | let g = 1632000600000 | |
15 | + | let h = 604800000 | |
16 | + | let i = ((lastBlock.timestamp - g) / h) | |
17 | 17 | let j = assetBalance(addressFromPublicKey(c.callerPublicKey), a) | |
18 | 18 | let k = getIntegerValue(this, (d + "_Total_Votes")) | |
19 | 19 | let l = (k + 1) | |
30 | 30 | else (d == "TN")) | |
31 | 31 | then true | |
32 | 32 | else (d == "WAVES")) | |
33 | - | then [StringEntry(("Voted_Asset_" + f), d), StringEntry("message", "<h1>You Voted Successfully!</h1><br>"), IntegerEntry("Current_Voting_Week", i), IntegerEntry((d + "_Total_Votes"), l), ScriptTransfer(c.caller, 1, a)] | |
33 | + | then [StringEntry(("Voted_Asset_" + f), d), StringEntry("message", "<h1>You Voted Successfully!</h1><br>"), IntegerEntry("Current_Voting_Week", i), IntegerEntry("Week0Timestamp", g), IntegerEntry("LastBlockTimeStamp", lastBlock.timestamp), IntegerEntry((d + "_Total_Votes"), l), ScriptTransfer(c.caller, 1, a)] | |
34 | 34 | else throw("Blank/Wrong Input Entered For Voting.") | |
35 | 35 | } | |
36 | 36 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'J9VzWPfRSQyCbEv5oWpxLSihigbpbJsGBHJZV9Ct8ook' | |
5 | 5 | ||
6 | 6 | let b = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
7 | 7 | ||
8 | 8 | @Callable(c) | |
9 | 9 | func Vote (d) = { | |
10 | 10 | let e = if ((size(c.payments) == 1)) | |
11 | 11 | then c.payments[0] | |
12 | 12 | else throw("0.0001 A4A Token is required as Attached payment[1].") | |
13 | 13 | let f = toBase58String(c.caller.bytes) | |
14 | - | let g = | |
15 | - | let h = | |
16 | - | let i = (( | |
14 | + | let g = 1632000600000 | |
15 | + | let h = 604800000 | |
16 | + | let i = ((lastBlock.timestamp - g) / h) | |
17 | 17 | let j = assetBalance(addressFromPublicKey(c.callerPublicKey), a) | |
18 | 18 | let k = getIntegerValue(this, (d + "_Total_Votes")) | |
19 | 19 | let l = (k + 1) | |
20 | 20 | if ((100000000 > j)) | |
21 | 21 | then throw("Minimum 1 A4A is required on Your Address to Vote. Please Mint or hold minimum 1 A4A on this Address.") | |
22 | 22 | else if ((e.assetId != a)) | |
23 | 23 | then throw((("Incorrect asset attached, please attach " + toBase58String(a)) + " AssetID Only.")) | |
24 | 24 | else if ((10000 > e.amount)) | |
25 | 25 | then throw("Please Attach minimum 0.0001 A4A To Vote.") | |
26 | 26 | else if (if (if (if ((d == "A4A")) | |
27 | 27 | then true | |
28 | 28 | else (d == "ARRR")) | |
29 | 29 | then true | |
30 | 30 | else (d == "TN")) | |
31 | 31 | then true | |
32 | 32 | else (d == "WAVES")) | |
33 | - | then [StringEntry(("Voted_Asset_" + f), d), StringEntry("message", "<h1>You Voted Successfully!</h1><br>"), IntegerEntry("Current_Voting_Week", i), IntegerEntry((d + "_Total_Votes"), l), ScriptTransfer(c.caller, 1, a)] | |
33 | + | then [StringEntry(("Voted_Asset_" + f), d), StringEntry("message", "<h1>You Voted Successfully!</h1><br>"), IntegerEntry("Current_Voting_Week", i), IntegerEntry("Week0Timestamp", g), IntegerEntry("LastBlockTimeStamp", lastBlock.timestamp), IntegerEntry((d + "_Total_Votes"), l), ScriptTransfer(c.caller, 1, a)] | |
34 | 34 | else throw("Blank/Wrong Input Entered For Voting.") | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Verifier(m) | |
39 | 39 | func n () = sigVerify(m.bodyBytes, m.proofs[0], m.senderPublicKey) | |
40 | 40 |
github/deemru/w8io/169f3d6 28.27 ms ◑