tx · Ei6hqfpLmnEBP1fYmuHVVnao35gun86SKhDfGucWsabr 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ: -0.01400000 Waves 2021.09.22 16:39 [1714333] smart account 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ > SELF 0.00000000 Waves
{ "type": 13, "id": "Ei6hqfpLmnEBP1fYmuHVVnao35gun86SKhDfGucWsabr", "fee": 1400000, "feeAssetId": null, "timestamp": 1632318014588, "version": 2, "chainId": 84, "sender": "3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ", "senderPublicKey": "BMLuSYJ8rvQD55waCoKpzCBhJAbY8s9pp4V5ZgxuzCBD", "proofs": [ "2UVqUJTLm3j4hzwBy1VF39ac7og1k3LH8qwgRskghhBQbd2wyV2Bdqx3dMUXkY9d15aQ3pMVXxgHAWBeyfy65qUz" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAAAgAAAAAKQTRBQXNzZXRJRAEAAAAg/sQa4d7v52kifRLo73ftXd9xD7wgh9JaaHT98W4IWDcAAAAAC1VTRFRBc3NldElEAQAAACAIZYS3D/CKahrz4mjoLgiQJMPTJ1gDzSz2Ll4L39oVpAAAAAEAAAABaQEAAAAKV2Vla2x5Vm90ZQAAAAEAAAAORmF2b3VyaXRlQXNzZXQEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAADlXZWVrbHkgVm90ZSBOZWVkIDAuMDAwMSBBNEEgVG9rZW4gYXMgQXR0YWNoZWQgcGF5bWVudFsxXS4EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAOV2VlazBUaW1lc3RhbXAAAAABezVny8AEAAAACGVhY2h3ZWVrAAAAAAAkDIQABAAAAAhlYWNoaG91cgAAAAAAADb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gkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAE01vZHVsZV9SdW5uaW5nX1dlZWsFAAAAEU1vZHVsZXJ1bm5pbmd3ZWVrCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAADkZhdm91cml0ZUFzc2V0AgAAAAxfVG90YWxfVm90ZXMFAAAACnRvdGFsdm90ZXMJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAApBNEFBc3NldElEBQAAAANuaWwJAAACAAAAAQIAAAAlQmxhbmsvV3JvbmcgSW5wdXQgRW50ZXJlZCBGb3IgVm90aW5nLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5nTcW4A==", "height": 1714333, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BwumHnRTJetumnaSKQhoxDBLsg9roKYCSsBw8Pr4Lmrq Next: AXTn6zQRD7nogqpe8JjJMu8hLvCuuVg7UwtBacdyjyG5 Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | let eachhour = 3600000 | |
17 | 17 | let votingpausetime = 3600000 | |
18 | 18 | let currentrunningweek = (((lastBlock.timestamp - Week0Timestamp) / eachweek) + 1) | |
19 | - | let Modulerunningweek = ( | |
19 | + | let Modulerunningweek = (lastBlock.timestamp % eachweek) | |
20 | 20 | let checkassetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), A4AAssetID) | |
21 | 21 | let fetchvotes = getIntegerValue(this, (FavouriteAsset + "_Total_Votes")) | |
22 | 22 | let totalvotes = (fetchvotes + 1) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let A4AAssetID = base58'J9VzWPfRSQyCbEv5oWpxLSihigbpbJsGBHJZV9Ct8ook' | |
5 | 5 | ||
6 | 6 | let USDTAssetID = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func WeeklyVote (FavouriteAsset) = { | |
10 | 10 | let pmt = if ((size(i.payments) == 1)) | |
11 | 11 | then i.payments[0] | |
12 | 12 | else throw("Weekly Vote Need 0.0001 A4A Token as Attached payment[1].") | |
13 | 13 | let currentKey = toBase58String(i.caller.bytes) | |
14 | 14 | let Week0Timestamp = 1628688600000 | |
15 | 15 | let eachweek = 604800000 | |
16 | 16 | let eachhour = 3600000 | |
17 | 17 | let votingpausetime = 3600000 | |
18 | 18 | let currentrunningweek = (((lastBlock.timestamp - Week0Timestamp) / eachweek) + 1) | |
19 | - | let Modulerunningweek = ( | |
19 | + | let Modulerunningweek = (lastBlock.timestamp % eachweek) | |
20 | 20 | let checkassetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), A4AAssetID) | |
21 | 21 | let fetchvotes = getIntegerValue(this, (FavouriteAsset + "_Total_Votes")) | |
22 | 22 | let totalvotes = (fetchvotes + 1) | |
23 | 23 | if ((100000000 > checkassetbal)) | |
24 | 24 | then throw("Minimum 1 A4A is required on Your Address to Vote. Please Mint or hold minimum 1 A4A on this Address.") | |
25 | 25 | else if ((pmt.assetId != A4AAssetID)) | |
26 | 26 | then throw((("Incorrect asset attached, please attach " + toBase58String(A4AAssetID)) + " AssetID Only.")) | |
27 | 27 | else if ((pmt.amount != 10000)) | |
28 | 28 | then throw("Please Attach Exact 0.0001 A4A To Vote.") | |
29 | 29 | else if ((votingpausetime > Modulerunningweek)) | |
30 | 30 | then throw((("Voting is paused for Next " + toString(((votingpausetime - Modulerunningweek) / 60000))) + " Minutes.")) | |
31 | 31 | else if (if (if (if ((FavouriteAsset == "A4A")) | |
32 | 32 | then true | |
33 | 33 | else (FavouriteAsset == "ARRR")) | |
34 | 34 | then true | |
35 | 35 | else (FavouriteAsset == "TN")) | |
36 | 36 | then true | |
37 | 37 | else (FavouriteAsset == "WAVES")) | |
38 | 38 | then [StringEntry(("Voted_Asset_" + currentKey), FavouriteAsset), StringEntry("message", "<h1>You Voted Successfully!</h1><br>"), IntegerEntry("Current_Voting_Week", currentrunningweek), IntegerEntry("Week0Timestamp", Week0Timestamp), IntegerEntry("LastBlockTimeStamp", lastBlock.timestamp), IntegerEntry("Module_Running_Week", Modulerunningweek), IntegerEntry((FavouriteAsset + "_Total_Votes"), totalvotes), ScriptTransfer(i.caller, 1, A4AAssetID)] | |
39 | 39 | else throw("Blank/Wrong Input Entered For Voting.") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Verifier(tx) | |
44 | 44 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
45 | 45 |
github/deemru/w8io/026f985 28.41 ms ◑