tx · 2FR1EE76MjudbuqrbPmqjKicBqxXg3vaL2w7Zyc1Ueir 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ: -0.01400000 Waves 2021.09.22 12:48 [1714091] smart account 3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ > SELF 0.00000000 Waves
{ "type": 13, "id": "2FR1EE76MjudbuqrbPmqjKicBqxXg3vaL2w7Zyc1Ueir", "fee": 1400000, "feeAssetId": null, "timestamp": 1632304096571, "version": 2, "chainId": 84, "sender": "3N17JMn4WESkhCSrcEwdADBZFAe8uiuvCGQ", "senderPublicKey": "BMLuSYJ8rvQD55waCoKpzCBhJAbY8s9pp4V5ZgxuzCBD", "proofs": [ "2SWNSMNx9qoFz7QZbwk1nogYuTo9rhHXop6t1q5DLRd2U77ZoMhvrY3KNrziCHefLaedZ7hfwhHDLERw9NDXt2u7" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAAAgAAAAAKQTRBQXNzZXRJRAEAAAAg/sQa4d7v52kifRLo73ftXd9xD7wgh9JaaHT98W4IWDcAAAAAC1VTRFRBc3NldElEAQAAACAIZYS3D/CKahrz4mjoLgiQJMPTJ1gDzSz2Ll4L39oVpAAAAAEAAAABaQEAAAAKV2Vla2x5Vm90ZQAAAAEAAAAORmF2b3VyaXRlQXNzZXQEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAADlXZWVrbHkgVm90ZSBOZWVkIDAuMDAwMSBBNEEgVG9rZW4gYXMgQXR0YWNoZWQgcGF5bWVudFsxXS4EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAOV2VlazBUaW1lc3RhbXAAAAABeyKFz8AEAAAACGVhY2h3ZWVrAAAAAAAkDIQABAAAAA92b3RpbmdwYX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AACdHgAAAAPc2VuZGVyUHVibGljS2V5vUreXA==", "height": 1714091, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8noYN8SfWeDEg5Xw7EZZysYKdhdC2iddvvwf1k4cSdyi Next: 3KGZTn6sYxr8x14nWwBxfRd8CaJPoJYL8FbusJDnZy4f Diff:
Old | New | Differences | |
---|---|---|---|
13 | 13 | let currentKey = toBase58String(i.caller.bytes) | |
14 | 14 | let Week0Timestamp = 1628371800000 | |
15 | 15 | let eachweek = 604800000 | |
16 | - | let currentrunningweek = ((lastBlock.timestamp - Week0Timestamp) / eachweek) | |
16 | + | let votingpausetime = 14400000 | |
17 | + | let currentrunningweek = ((lastBlock.timestamp - Week0Timestamp) % eachweek) | |
17 | 18 | let checkassetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), A4AAssetID) | |
18 | 19 | let fetchvotes = getIntegerValue(this, (FavouriteAsset + "_Total_Votes")) | |
19 | 20 | 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 = 1628371800000 | |
15 | 15 | let eachweek = 604800000 | |
16 | - | let currentrunningweek = ((lastBlock.timestamp - Week0Timestamp) / eachweek) | |
16 | + | let votingpausetime = 14400000 | |
17 | + | let currentrunningweek = ((lastBlock.timestamp - Week0Timestamp) % eachweek) | |
17 | 18 | let checkassetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), A4AAssetID) | |
18 | 19 | let fetchvotes = getIntegerValue(this, (FavouriteAsset + "_Total_Votes")) | |
19 | 20 | let totalvotes = (fetchvotes + 1) | |
20 | 21 | if ((100000000 > checkassetbal)) | |
21 | 22 | then throw("Minimum 1 A4A is required on Your Address to Vote. Please Mint or hold minimum 1 A4A on this Address.") | |
22 | 23 | else if ((pmt.assetId != A4AAssetID)) | |
23 | 24 | then throw((("Incorrect asset attached, please attach " + toBase58String(A4AAssetID)) + " AssetID Only.")) | |
24 | 25 | else if ((pmt.amount != 10000)) | |
25 | 26 | then throw("Please Attach Exact 0.0001 A4A To Vote.") | |
26 | 27 | else if (if (if (if ((FavouriteAsset == "A4A")) | |
27 | 28 | then true | |
28 | 29 | else (FavouriteAsset == "ARRR")) | |
29 | 30 | then true | |
30 | 31 | else (FavouriteAsset == "TN")) | |
31 | 32 | then true | |
32 | 33 | else (FavouriteAsset == "WAVES")) | |
33 | 34 | 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((FavouriteAsset + "_Total_Votes"), totalvotes), ScriptTransfer(i.caller, 1, A4AAssetID)] | |
34 | 35 | else throw("Blank/Wrong Input Entered For Voting.") | |
35 | 36 | } | |
36 | 37 | ||
37 | 38 | ||
38 | 39 | @Verifier(tx) | |
39 | 40 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
40 | 41 |
github/deemru/w8io/169f3d6 42.51 ms ◑