tx · 6XLZV65AbZAtLjPGmgFXadNZyw3wKLtDBde5kyVjFsBb 3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT: -0.01400000 Waves 2023.04.06 13:40 [2522594] smart account 3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT > SELF 0.00000000 Waves
{ "type": 13, "id": "6XLZV65AbZAtLjPGmgFXadNZyw3wKLtDBde5kyVjFsBb", "fee": 1400000, "feeAssetId": null, "timestamp": 1680777674636, "version": 2, "chainId": 84, "sender": "3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT", "senderPublicKey": "86kQutchNhkrbHTdTXbAFXcJ8bPWQC8G4RGzAYcspLvb", "proofs": [ "2XAhzkhYGW34wVsUboJ1faQWYDhWUDPYmbzVxb4CK7pmgicgAdAFP2Cu2QZBJKBaMVkSkjED6NB3R7a1tqLNozRs" ], "script": "base64:AAIEAAAAAAAAAB0IAhIFCgMIAQESAwoBARIDCgEBEgMKAQESAwoBCAAAAAkAAAAABFZPVEUBAAAAIAhlhLcP8IpqGvPiaOguCJAkw9MnWAPNLPYuXgvf2hWkAAAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AQAAACAbvUu+h+2As3kugOhMQC3bvgebie3kDmlbUlrvLFQPbQAAAAASY29udHJvbGxlcl9hZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AAAAAAxsYXVuY2hfZXJyb3ICAAAAJERhcHAgd2lsbCBzdGFydCBWb3RpbmcgYXQgVGltZXN0YW1wIAAAAAADbXNnAgAAAC48aDE+WW91ciBWb3RlIFN1Ym1pdHRlZCBTdWNjZXNzZnVsbHkhPC9oMT48YnI+AAAAAAlweW10ZXJyb3ICAAAANURBcHAgTmVlZCAwLjAwMDAwMDAxIFZPVEUgVG9rZW4gYXMgQXR0YWNoIHBheW1lbnRbMV0uAAAA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dhc3NldElkBQAAAARWT1RFCQAAAgAAAAEFAAAACGFzc2V0ZXJyAwkAAGYAAAACCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAUAAAAFRW5kVFMJAAACAAAAAQUAAAAHdm90ZUVycgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxUb3RhbF9Wb3Rlc18JAAGkAAAAAQUAAAALUG9ycG9zYWxfSUQFAAAACnRvdGFsdm90ZXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABlRvdGFsXwUAAAAHVm90ZUFzdAIAAAABXwkAAaQAAAABBQAAAAtQb3Jwb3NhbF9JRAUAAAAEQVRWTwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAdtZXNzYWdlBQAAAANtc2cFAAAAA25pbAAAAAFpAQAAAAlEZWxldGVLZXkAAAABAAAAA0tleQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAANLZXkFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5wJ3I3g==", "height": 2522594, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: wD2p5ZBm8gnseXiTBiGBtcPvVg2qN6WWqcXMzhYqPZV Next: HVorMwhDZHkQKKnP24ugFM6dngYt6SUmmnYn2YjTFLYq Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.") | |
36 | 36 | else if ((i.caller != controller_address)) | |
37 | 37 | then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it.")) | |
38 | - | else [StringEntry(("Proposal_ | |
38 | + | else [StringEntry(("Proposal_Text_" + toString(totalproposals)), Proposal), IntegerEntry("Total_Proposals", totalproposals), StringEntry(("Proposer_" + toString(totalproposals)), pubkey), IntegerEntry(("Voting_Start_TimeStamp_" + toString(totalproposals)), StartTS), IntegerEntry(("Voting_End_TimeStamp_" + toString(totalproposals)), EndTS)] | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | - | func DeleteKey (Key) = [DeleteEntry("Proposal Data_1"), DeleteEntry("Proposal Data_2"), DeleteEntry("Proposal_Data_3"), DeleteEntry(Key)] | |
81 | + | func No (Porposal_ID) = { | |
82 | + | let VoteAst = "No" | |
83 | + | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
84 | + | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
85 | + | let pubkey = toBase58String(i.caller.bytes) | |
86 | + | let pmt = if ((size(i.payments) == 1)) | |
87 | + | then i.payments[0] | |
88 | + | else throw(pymterror) | |
89 | + | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) | |
90 | + | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
91 | + | case a: Int => | |
92 | + | a | |
93 | + | case _ => | |
94 | + | 0 | |
95 | + | } | |
96 | + | let totalvotes = (Previoustotalvotes + pmt.amount) | |
97 | + | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
98 | + | case a: Int => | |
99 | + | a | |
100 | + | case _ => | |
101 | + | 0 | |
102 | + | } | |
103 | + | let ATVO = (FTVO + pmt.amount) | |
104 | + | if ((StartTS > lastBlock.timestamp)) | |
105 | + | then throw((launch_error + toString(StartTS))) | |
106 | + | else if ((1 > assetbal)) | |
107 | + | then throw(minbalerror) | |
108 | + | else if ((pmt.assetId != VOTE)) | |
109 | + | then throw(asseterr) | |
110 | + | else if ((lastBlock.timestamp > EndTS)) | |
111 | + | then throw(voteErr) | |
112 | + | else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), StringEntry("message", msg)] | |
113 | + | } | |
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | @Callable(i) | |
118 | + | func Abstain (Porposal_ID) = { | |
119 | + | let VoteAst = "Abstain" | |
120 | + | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
121 | + | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
122 | + | let pubkey = toBase58String(i.caller.bytes) | |
123 | + | let pmt = if ((size(i.payments) == 1)) | |
124 | + | then i.payments[0] | |
125 | + | else throw(pymterror) | |
126 | + | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) | |
127 | + | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
128 | + | case a: Int => | |
129 | + | a | |
130 | + | case _ => | |
131 | + | 0 | |
132 | + | } | |
133 | + | let totalvotes = (Previoustotalvotes + pmt.amount) | |
134 | + | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
135 | + | case a: Int => | |
136 | + | a | |
137 | + | case _ => | |
138 | + | 0 | |
139 | + | } | |
140 | + | let ATVO = (FTVO + pmt.amount) | |
141 | + | if ((StartTS > lastBlock.timestamp)) | |
142 | + | then throw((launch_error + toString(StartTS))) | |
143 | + | else if ((1 > assetbal)) | |
144 | + | then throw(minbalerror) | |
145 | + | else if ((pmt.assetId != VOTE)) | |
146 | + | then throw(asseterr) | |
147 | + | else if ((lastBlock.timestamp > EndTS)) | |
148 | + | then throw(voteErr) | |
149 | + | else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), StringEntry("message", msg)] | |
150 | + | } | |
151 | + | ||
152 | + | ||
153 | + | ||
154 | + | @Callable(i) | |
155 | + | func DeleteKey (Key) = [DeleteEntry(Key)] | |
82 | 156 | ||
83 | 157 | ||
84 | 158 | @Verifier(tx) |
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>Your Vote Submitted Successfully!</h1><br>" | |
13 | 13 | ||
14 | 14 | let pymterror = "DApp Need 0.00000001 VOTE Token as Attach payment[1]." | |
15 | 15 | ||
16 | 16 | let minbalerror = "Min. 0.00000001 VOTE required on Your Address to Vote. Please Mint or hold min. 0.00000001 VOTE on this Address." | |
17 | 17 | ||
18 | 18 | let asseterr = (("Incorrect asset attach, please attach " + toBase58String(VOTE)) + " AssetID Only.") | |
19 | 19 | ||
20 | 20 | let voteErr = "Voting is Over for this Dapp." | |
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func SetVotingTimeStamps (Proposal,Voting_Start_TimeStamp,Voting_End_TimeStamp) = { | |
24 | 24 | let StartTS = Voting_Start_TimeStamp | |
25 | 25 | let EndTS = Voting_End_TimeStamp | |
26 | 26 | let pubkey = toBase58String(i.caller.bytes) | |
27 | 27 | let Previoustotalproposals = match getInteger(this, "Total_Proposals") { | |
28 | 28 | case a: Int => | |
29 | 29 | a | |
30 | 30 | case _ => | |
31 | 31 | 0 | |
32 | 32 | } | |
33 | 33 | let totalproposals = (Previoustotalproposals + 1) | |
34 | 34 | if ((size(Proposal) > 5100)) | |
35 | 35 | then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.") | |
36 | 36 | else if ((i.caller != controller_address)) | |
37 | 37 | then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it.")) | |
38 | - | else [StringEntry(("Proposal_ | |
38 | + | else [StringEntry(("Proposal_Text_" + toString(totalproposals)), Proposal), IntegerEntry("Total_Proposals", totalproposals), StringEntry(("Proposer_" + toString(totalproposals)), pubkey), IntegerEntry(("Voting_Start_TimeStamp_" + toString(totalproposals)), StartTS), IntegerEntry(("Voting_End_TimeStamp_" + toString(totalproposals)), EndTS)] | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(i) | |
44 | 44 | func Yes (Porposal_ID) = { | |
45 | 45 | let VoteAst = "Yes" | |
46 | 46 | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
47 | 47 | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
48 | 48 | let pubkey = toBase58String(i.caller.bytes) | |
49 | 49 | let pmt = if ((size(i.payments) == 1)) | |
50 | 50 | then i.payments[0] | |
51 | 51 | else throw(pymterror) | |
52 | 52 | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) | |
53 | 53 | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
54 | 54 | case a: Int => | |
55 | 55 | a | |
56 | 56 | case _ => | |
57 | 57 | 0 | |
58 | 58 | } | |
59 | 59 | let totalvotes = (Previoustotalvotes + pmt.amount) | |
60 | 60 | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
61 | 61 | case a: Int => | |
62 | 62 | a | |
63 | 63 | case _ => | |
64 | 64 | 0 | |
65 | 65 | } | |
66 | 66 | let ATVO = (FTVO + pmt.amount) | |
67 | 67 | if ((StartTS > lastBlock.timestamp)) | |
68 | 68 | then throw((launch_error + toString(StartTS))) | |
69 | 69 | else if ((1 > assetbal)) | |
70 | 70 | then throw(minbalerror) | |
71 | 71 | else if ((pmt.assetId != VOTE)) | |
72 | 72 | then throw(asseterr) | |
73 | 73 | else if ((lastBlock.timestamp > EndTS)) | |
74 | 74 | then throw(voteErr) | |
75 | 75 | else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), StringEntry("message", msg)] | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | - | func DeleteKey (Key) = [DeleteEntry("Proposal Data_1"), DeleteEntry("Proposal Data_2"), DeleteEntry("Proposal_Data_3"), DeleteEntry(Key)] | |
81 | + | func No (Porposal_ID) = { | |
82 | + | let VoteAst = "No" | |
83 | + | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
84 | + | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
85 | + | let pubkey = toBase58String(i.caller.bytes) | |
86 | + | let pmt = if ((size(i.payments) == 1)) | |
87 | + | then i.payments[0] | |
88 | + | else throw(pymterror) | |
89 | + | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) | |
90 | + | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
91 | + | case a: Int => | |
92 | + | a | |
93 | + | case _ => | |
94 | + | 0 | |
95 | + | } | |
96 | + | let totalvotes = (Previoustotalvotes + pmt.amount) | |
97 | + | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
98 | + | case a: Int => | |
99 | + | a | |
100 | + | case _ => | |
101 | + | 0 | |
102 | + | } | |
103 | + | let ATVO = (FTVO + pmt.amount) | |
104 | + | if ((StartTS > lastBlock.timestamp)) | |
105 | + | then throw((launch_error + toString(StartTS))) | |
106 | + | else if ((1 > assetbal)) | |
107 | + | then throw(minbalerror) | |
108 | + | else if ((pmt.assetId != VOTE)) | |
109 | + | then throw(asseterr) | |
110 | + | else if ((lastBlock.timestamp > EndTS)) | |
111 | + | then throw(voteErr) | |
112 | + | else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), StringEntry("message", msg)] | |
113 | + | } | |
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | @Callable(i) | |
118 | + | func Abstain (Porposal_ID) = { | |
119 | + | let VoteAst = "Abstain" | |
120 | + | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
121 | + | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
122 | + | let pubkey = toBase58String(i.caller.bytes) | |
123 | + | let pmt = if ((size(i.payments) == 1)) | |
124 | + | then i.payments[0] | |
125 | + | else throw(pymterror) | |
126 | + | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) | |
127 | + | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
128 | + | case a: Int => | |
129 | + | a | |
130 | + | case _ => | |
131 | + | 0 | |
132 | + | } | |
133 | + | let totalvotes = (Previoustotalvotes + pmt.amount) | |
134 | + | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
135 | + | case a: Int => | |
136 | + | a | |
137 | + | case _ => | |
138 | + | 0 | |
139 | + | } | |
140 | + | let ATVO = (FTVO + pmt.amount) | |
141 | + | if ((StartTS > lastBlock.timestamp)) | |
142 | + | then throw((launch_error + toString(StartTS))) | |
143 | + | else if ((1 > assetbal)) | |
144 | + | then throw(minbalerror) | |
145 | + | else if ((pmt.assetId != VOTE)) | |
146 | + | then throw(asseterr) | |
147 | + | else if ((lastBlock.timestamp > EndTS)) | |
148 | + | then throw(voteErr) | |
149 | + | else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), StringEntry("message", msg)] | |
150 | + | } | |
151 | + | ||
152 | + | ||
153 | + | ||
154 | + | @Callable(i) | |
155 | + | func DeleteKey (Key) = [DeleteEntry(Key)] | |
82 | 156 | ||
83 | 157 | ||
84 | 158 | @Verifier(tx) | |
85 | 159 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
86 | 160 |
github/deemru/w8io/169f3d6 35.17 ms ◑