tx · 8tNuu3QdenXanEmqb62MoLvwwJTeAJyuUkSqw666ckd9 3NBLecFWuYaQuc56Nt6nZm8jdPt9f8vfyFr: -0.01400000 Waves 2023.03.13 14:21 [2488184] smart account 3NBLecFWuYaQuc56Nt6nZm8jdPt9f8vfyFr > SELF 0.00000000 Waves
{ "type": 13, "id": "8tNuu3QdenXanEmqb62MoLvwwJTeAJyuUkSqw666ckd9", "fee": 1400000, "feeAssetId": null, "timestamp": 1678706571915, "version": 2, "chainId": 84, "sender": "3NBLecFWuYaQuc56Nt6nZm8jdPt9f8vfyFr", "senderPublicKey": "GV3FbBXZru1WpaCa9x1zhwSWrXSDrxKMVEV7BML6EzY1", "proofs": [ "5QzFP6xjv7dfBThNELTcMk4SiPNccNHapKTwWShp2v2QSnvDCh5VSRRV5jxhPrHcxNxzi2UyheSRhhQDS9AhdMif" ], "script": "base64:AAIEAAAAAAAAAAsIAhIFCgMBAQESAAAAAA0AAAAABFZPVEUBAAAAIAhlhLcP8IpqGvPiaOguCJAkw9MnWAPNLPYuXgvf2hWkAAAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AQAAACAbvUu+h+2As3kugOhMQC3bvgebie3kDmlbUlrvLFQPbQAAAAASY29udHJvbGxlcl9hZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AAAAAAxsYXVuY2hfZXJyb3ICAAAAJERhcHAgd2lsbCBzdGFydCBWb3RpbmcgYXQgVGltZXN0YW1wIAAAAAADbXNnAgAAAC08aDE+WW91IFZvdGUgU3VibWl0dGVkIFN1Y2Nlc3NmdWxseSE8L2gxPjxicj4AAAAACXB5bXRlcnJvcgIAAAAsREFwcCBOZWVkIDEgVk9URSBUb2tlbiBhcyBBdHRhY2ggcGF5bWVudFsxXS4AAAAAC21pbmJhbGVycm9yAgAAAF5NaW4uIDEgVk9URSByZX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VBc3QFAAAABVVUVkZBCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAB21lc3NhZ2UFAAAAA21zZwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlZ4dhD", "height": 2488184, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E5kiUeHyKV9F7vGadeFsTYDN4qaqbb8GVvGWAGQeLiLG Next: DrW6RfPzSEUDwitFouUtoTkR3gTwDedwgSUHmsUBN68W Diff:
Old | New | Differences | |
---|---|---|---|
89 | 89 | then throw(asseterr) | |
90 | 90 | else if ((pmt.amount != 1)) | |
91 | 91 | then throw(minamterr) | |
92 | - | else if ((User_total_Votes > 1)) | |
93 | - | then throw(AlreadyVotedErr) | |
94 | - | else if ((lastBlock.timestamp > EndTS)) | |
95 | - | then throw(voteErr) | |
96 | - | else [IntegerEntry("Total_Votes", totalvotes), IntegerEntry(("Total_Votes_" + VoteAst), ATVO), IntegerEntry(("User_Total_Votes_" + pubkey), User_total_Votes), IntegerEntry(((("User_Total_Votes_" + pubkey) + "-") + VoteAst), UTWVFA), IntegerEntry(((("User_Total_Asset_Votes_" + pubkey) + "_") + VoteAst), UTVFA), StringEntry("message", msg)] | |
92 | + | else if ((lastBlock.timestamp > EndTS)) | |
93 | + | then throw(voteErr) | |
94 | + | else [IntegerEntry("Total_Votes", totalvotes), IntegerEntry(("Total_Votes_" + VoteAst), ATVO), IntegerEntry(("User_Total_Votes_" + pubkey), User_total_Votes), IntegerEntry(((("User_Total_Votes_" + pubkey) + "-") + VoteAst), UTWVFA), IntegerEntry(((("User_Total_Asset_Votes_" + pubkey) + "_") + VoteAst), UTVFA), StringEntry("message", msg)] | |
97 | 95 | } | |
98 | 96 | ||
99 | 97 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let VOTE = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
5 | 5 | ||
6 | 6 | let voting_timestamp_controller_pubkey = base58'2sHRUrJCMpDhAQEcN7Zhk3LqnD9zizebpxeQXpPoscQU' | |
7 | 7 | ||
8 | 8 | let controller_address = addressFromPublicKey(voting_timestamp_controller_pubkey) | |
9 | 9 | ||
10 | 10 | let launch_error = "Dapp will start Voting at Timestamp " | |
11 | 11 | ||
12 | 12 | let msg = "<h1>You Vote Submitted Successfully!</h1><br>" | |
13 | 13 | ||
14 | 14 | let pymterror = "DApp Need 1 VOTE Token as Attach payment[1]." | |
15 | 15 | ||
16 | 16 | let minbalerror = "Min. 1 VOTE required on Your Address to Vote. Please Mint or hold min. 1 VOTE on this Address." | |
17 | 17 | ||
18 | 18 | let asseterr = (("Incorrect asset attach, please attach " + toBase58String(VOTE)) + " AssetID Only.") | |
19 | 19 | ||
20 | 20 | let minamterr = "Please Attach Exact 1 VOTE To Vote." | |
21 | 21 | ||
22 | 22 | let voteErr = "Voting is Over for this Dapp." | |
23 | 23 | ||
24 | 24 | let AlreadyVotedErr = "You have Already Voted from this address." | |
25 | 25 | ||
26 | 26 | let Previoustotalvotes = match getInteger(this, "Total_Votes") { | |
27 | 27 | case a: Int => | |
28 | 28 | a | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | let totalvotes = (Previoustotalvotes + 1) | |
34 | 34 | ||
35 | 35 | @Callable(i) | |
36 | 36 | func SetVotingTimeStamps (Voting_Start_TimeStamp,Voting_End_TimeStamp,Total_Distrbuted_Tokens) = { | |
37 | 37 | let StartTS = Voting_Start_TimeStamp | |
38 | 38 | let EndTS = Voting_End_TimeStamp | |
39 | 39 | if ((i.caller != controller_address)) | |
40 | 40 | then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it.")) | |
41 | 41 | else [IntegerEntry("Voting_Start_TimeStamp", StartTS), IntegerEntry("Voting_End_TimeStamp", EndTS), IntegerEntry("Total_Tokens_Distributed", Total_Distrbuted_Tokens)] | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func Option1 () = { | |
48 | 48 | let VoteAst = "OPTION1" | |
49 | 49 | let StartTS = getIntegerValue(this, "Voting_Start_TimeStamp") | |
50 | 50 | let EndTS = getIntegerValue(this, "Voting_End_TimeStamp") | |
51 | 51 | let pubkey = toBase58String(i.caller.bytes) | |
52 | 52 | let pmt = if ((size(i.payments) == 1)) | |
53 | 53 | then i.payments[0] | |
54 | 54 | else throw(pymterror) | |
55 | 55 | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) | |
56 | 56 | let Previous_User_total_Votes = match getInteger(this, ("User_Total_Votes_" + pubkey)) { | |
57 | 57 | case a: Int => | |
58 | 58 | a | |
59 | 59 | case _ => | |
60 | 60 | 0 | |
61 | 61 | } | |
62 | 62 | let User_total_Votes = (Previous_User_total_Votes + 1) | |
63 | 63 | let UWVFA = match getInteger(this, ((("User_Total_Votes_" + pubkey) + "-") + VoteAst)) { | |
64 | 64 | case a: Int => | |
65 | 65 | a | |
66 | 66 | case _ => | |
67 | 67 | 0 | |
68 | 68 | } | |
69 | 69 | let UTWVFA = (UWVFA + 1) | |
70 | 70 | let FUVFA = match getInteger(this, ((("User_Total_Asset_Votes_" + pubkey) + "_") + VoteAst)) { | |
71 | 71 | case a: Int => | |
72 | 72 | a | |
73 | 73 | case _ => | |
74 | 74 | 0 | |
75 | 75 | } | |
76 | 76 | let UTVFA = (FUVFA + 1) | |
77 | 77 | let FTVO = match getInteger(this, ("Total_Votes_" + VoteAst)) { | |
78 | 78 | case a: Int => | |
79 | 79 | a | |
80 | 80 | case _ => | |
81 | 81 | 0 | |
82 | 82 | } | |
83 | 83 | let ATVO = (FTVO + 1) | |
84 | 84 | if ((StartTS > lastBlock.timestamp)) | |
85 | 85 | then throw((launch_error + toString(StartTS))) | |
86 | 86 | else if ((1 > assetbal)) | |
87 | 87 | then throw(minbalerror) | |
88 | 88 | else if ((pmt.assetId != VOTE)) | |
89 | 89 | then throw(asseterr) | |
90 | 90 | else if ((pmt.amount != 1)) | |
91 | 91 | then throw(minamterr) | |
92 | - | else if ((User_total_Votes > 1)) | |
93 | - | then throw(AlreadyVotedErr) | |
94 | - | else if ((lastBlock.timestamp > EndTS)) | |
95 | - | then throw(voteErr) | |
96 | - | else [IntegerEntry("Total_Votes", totalvotes), IntegerEntry(("Total_Votes_" + VoteAst), ATVO), IntegerEntry(("User_Total_Votes_" + pubkey), User_total_Votes), IntegerEntry(((("User_Total_Votes_" + pubkey) + "-") + VoteAst), UTWVFA), IntegerEntry(((("User_Total_Asset_Votes_" + pubkey) + "_") + VoteAst), UTVFA), StringEntry("message", msg)] | |
92 | + | else if ((lastBlock.timestamp > EndTS)) | |
93 | + | then throw(voteErr) | |
94 | + | else [IntegerEntry("Total_Votes", totalvotes), IntegerEntry(("Total_Votes_" + VoteAst), ATVO), IntegerEntry(("User_Total_Votes_" + pubkey), User_total_Votes), IntegerEntry(((("User_Total_Votes_" + pubkey) + "-") + VoteAst), UTWVFA), IntegerEntry(((("User_Total_Asset_Votes_" + pubkey) + "_") + VoteAst), UTVFA), StringEntry("message", msg)] | |
97 | 95 | } | |
98 | 96 | ||
99 | 97 | ||
100 | 98 | @Verifier(tx) | |
101 | 99 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
102 | 100 |
github/deemru/w8io/169f3d6 28.00 ms ◑