tx · E2GuSsvnQQECUi5VpB4WpnjzFGZ2sFpHMEGiXNPERBvR

3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd:  -0.01400000 Waves

2023.04.14 16:44 [2534280] smart account 3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd > SELF 0.00000000 Waves

{ "type": 13, "id": "E2GuSsvnQQECUi5VpB4WpnjzFGZ2sFpHMEGiXNPERBvR", "fee": 1400000, "feeAssetId": null, "timestamp": 1681479867937, "version": 2, "chainId": 84, "sender": "3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd", "senderPublicKey": "AK6rRKpHobxNveEtJE5BBXbdwm9BpGL7ewP9Xb6VYuHx", "proofs": [ "DeenKhe8C522YEQvLM1fTNPE2MsukEBxtTjvDtM861ZxEfWm1wcwUDija2dBhg8ZgRDiUtGMz9sf8DTrBvVCkV6" ], "script": "base64:AAIEAAAAAAAAAA4IAhIFCgMIAQESAwoBAQAAAAcAAAAADkE0QVN0YWtpbmdEQXBwCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABAgAAACMzTjZvV0x5UVkyZ003UVVrVXZCbWUxUkVuQTZkMVY3eTNBVAAAAAAidm90aW5nX3RpbWVzdGFtcF9jb250cm9sbGVyX3B1YmtleQEAAAAgO3RF8b5QOeRSsZiONgCOv+riQ9YfIBAqDV0YsQ0EQwwAAAAAEmNvbnRyb2xsZXJfYWRkcmVzcwkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQUAAAAidm90aW5nX3RpbWVzdGFtcF9jb250cm9sbGVyX3B1YmtleQAAAAAMbGF1bmNoX2Vycm9yAgAAACREYXBwIHdpbGwgc3RhcnQgVm90aW5nIGF0IFRpbWVzdGFtcCAAAAAAA21zZwIAAAAuPGgxPllvdXIgVm90ZSBTdWJtaXR0ZWQgU3VjY2Vzc2Z1bGx5ITwvaDE+PGJyPgAAAAARQWxyZWFkeVZvdGVkRXJyb3ICAAAAPlRoaXMgQWRkcmVzc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Wx1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxUb3RhbF9Wb3Rlc18JAAGkAAAAAQUAAAALUG9ycG9zYWxfSUQFAAAACnRvdGFsdm90ZXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABlRvdGFsXwUAAAAHVm90ZUFzdAIAAAABXwkAAaQAAAABBQAAAAtQb3Jwb3NhbF9JRAUAAAAEQVRWTwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAABnB1YmtleQIAAAABXwkAAaQAAAABBQAAAAtQb3Jwb3NhbF9JRAUAAAAYTGF0ZXN0VXNlckNvdW50Zm9yVm90aW5nCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAOUXVvcnVtX1N0YXR1c18JAAGkAAAAAQUAAAALUG9ycG9zYWxfSUQCAAAABFBhc3MJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAHbWVzc2FnZQUAAAADbXNnBQAAAANuaWwFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5olhAzw==", "height": 2534280, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6cp8saB11g67dp49fW27R4gBva5SeV4LxwBqK8kbwGM7 Next: 2yWDvu2q89GZkxDJoydYDbAucwZ2uuCBLscrP3Lte5YY Diff:
OldNewDifferences
3333 then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.")
3434 else if ((i.caller != controller_address))
3535 then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it."))
36- 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), IntegerEntry(("Quorum_" + toString(totalproposals)), QuorumValue), IntegerEntry(("Total_Votes_" + toString(totalproposals)), 0), IntegerEntry(("Total_No_" + toString(totalproposals)), 0), IntegerEntry(("Total_Yes_" + toString(totalproposals)), 0)]
36+ 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), IntegerEntry(("Quorum_" + toString(totalproposals)), QuorumValue), IntegerEntry(("Total_Votes_" + toString(totalproposals)), 0), IntegerEntry(("Total_No_" + toString(totalproposals)), 0), IntegerEntry(("Total_Yes_" + toString(totalproposals)), 0), StringEntry(("Quorum_Status_" + toString(totalproposals)), "Fail")]
3737 }
3838
3939
4646 let pubkey = toBase58String(i.caller.bytes)
4747 let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.")
4848 let readQuoraumValue = getIntegerValue(this, ("Quorum_" + toString(Porposal_ID)))
49+ let readTotalNoVotesValue = getIntegerValue(this, ("Total_No_" + toString(Porposal_ID)))
4950 let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) {
5051 case a: Int =>
5152 a
7172 then throw((launch_error + toString(StartTS)))
7273 else if ((lastBlock.timestamp > EndTS))
7374 then throw(voteErr)
74- else if ((readQuoraumValue > ATVO))
75+ else if ((readQuoraumValue > totalvotes))
7576 then [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Fail"), StringEntry("message", msg)]
76- else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Pass"), StringEntry("message", msg)]
77- }
78-
79-
80-
81-@Callable(i)
82-func No (Porposal_ID) = {
83- let VoteAst = "No"
84- let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID)))
85- let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID)))
86- let pubkey = toBase58String(i.caller.bytes)
87- let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.")
88- let readQuoraumValue = getIntegerValue(this, ("Quorum_" + toString(Porposal_ID)))
89- let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) {
90- case a: Int =>
91- a
92- case _ =>
93- 0
94- }
95- let totalvotes = (Previoustotalvotes + readA4AStakingAmount)
96- let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) {
97- case a: Int =>
98- a
99- case _ =>
100- 0
101- }
102- let ATVO = (FTVO + readA4AStakingAmount)
103- let PreviousUserCountforVoting = match getInteger(this, ((pubkey + "_") + toString(Porposal_ID))) {
104- case a: Int =>
105- a
106- case _ =>
107- 0
108- }
109- let LatestUserCountforVoting = (PreviousUserCountforVoting + 1)
110- if ((StartTS > lastBlock.timestamp))
111- then throw((launch_error + toString(StartTS)))
112- else if ((lastBlock.timestamp > EndTS))
113- then throw(voteErr)
114- else if ((readQuoraumValue > ATVO))
115- then [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Fail"), StringEntry("message", msg)]
116- else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Fail"), StringEntry("message", msg)]
77+ else if ((totalvotes > readQuoraumValue))
78+ then [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Pass"), StringEntry("message", msg)]
79+ else nil
11780 }
11881
11982
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let A4AStakingDApp = addressFromStringValue("3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT")
55
66 let voting_timestamp_controller_pubkey = base58'515tSAyMUbAb8kKjcpGDpqALGfCgcwfWmWKKkcBKTcGB'
77
88 let controller_address = addressFromPublicKey(voting_timestamp_controller_pubkey)
99
1010 let launch_error = "Dapp will start Voting at Timestamp "
1111
1212 let msg = "<h1>Your Vote Submitted Successfully!</h1><br>"
1313
1414 let AlreadyVotedError = "This Address Already participated for Voting in this Proposal."
1515
1616 let voteErr = "Voting is Over for this Dapp."
1717
1818 @Callable(i)
1919 func SetVotingTimeStamps (Proposal,Voting_Start_TimeStamp,Voting_End_TimeStamp) = {
2020 let StartTS = Voting_Start_TimeStamp
2121 let EndTS = Voting_End_TimeStamp
2222 let readtotalStakedA4A = getIntegerValue(A4AStakingDApp, "Staked_Amount")
2323 let QuorumValue = fraction(readtotalStakedA4A, 1, 3)
2424 let pubkey = toBase58String(i.caller.bytes)
2525 let Previoustotalproposals = match getInteger(this, "Total_Proposals") {
2626 case a: Int =>
2727 a
2828 case _ =>
2929 0
3030 }
3131 let totalproposals = (Previoustotalproposals + 1)
3232 if ((size(Proposal) > 5100))
3333 then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.")
3434 else if ((i.caller != controller_address))
3535 then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it."))
36- 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), IntegerEntry(("Quorum_" + toString(totalproposals)), QuorumValue), IntegerEntry(("Total_Votes_" + toString(totalproposals)), 0), IntegerEntry(("Total_No_" + toString(totalproposals)), 0), IntegerEntry(("Total_Yes_" + toString(totalproposals)), 0)]
36+ 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), IntegerEntry(("Quorum_" + toString(totalproposals)), QuorumValue), IntegerEntry(("Total_Votes_" + toString(totalproposals)), 0), IntegerEntry(("Total_No_" + toString(totalproposals)), 0), IntegerEntry(("Total_Yes_" + toString(totalproposals)), 0), StringEntry(("Quorum_Status_" + toString(totalproposals)), "Fail")]
3737 }
3838
3939
4040
4141 @Callable(i)
4242 func Yes (Porposal_ID) = {
4343 let VoteAst = "Yes"
4444 let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID)))
4545 let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID)))
4646 let pubkey = toBase58String(i.caller.bytes)
4747 let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.")
4848 let readQuoraumValue = getIntegerValue(this, ("Quorum_" + toString(Porposal_ID)))
49+ let readTotalNoVotesValue = getIntegerValue(this, ("Total_No_" + toString(Porposal_ID)))
4950 let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) {
5051 case a: Int =>
5152 a
5253 case _ =>
5354 0
5455 }
5556 let totalvotes = (Previoustotalvotes + readA4AStakingAmount)
5657 let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) {
5758 case a: Int =>
5859 a
5960 case _ =>
6061 0
6162 }
6263 let ATVO = (FTVO + readA4AStakingAmount)
6364 let PreviousUserCountforVoting = match getInteger(this, ((pubkey + "_") + toString(Porposal_ID))) {
6465 case a: Int =>
6566 a
6667 case _ =>
6768 0
6869 }
6970 let LatestUserCountforVoting = (PreviousUserCountforVoting + 1)
7071 if ((StartTS > lastBlock.timestamp))
7172 then throw((launch_error + toString(StartTS)))
7273 else if ((lastBlock.timestamp > EndTS))
7374 then throw(voteErr)
74- else if ((readQuoraumValue > ATVO))
75+ else if ((readQuoraumValue > totalvotes))
7576 then [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Fail"), StringEntry("message", msg)]
76- else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Pass"), StringEntry("message", msg)]
77- }
78-
79-
80-
81-@Callable(i)
82-func No (Porposal_ID) = {
83- let VoteAst = "No"
84- let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID)))
85- let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID)))
86- let pubkey = toBase58String(i.caller.bytes)
87- let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.")
88- let readQuoraumValue = getIntegerValue(this, ("Quorum_" + toString(Porposal_ID)))
89- let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) {
90- case a: Int =>
91- a
92- case _ =>
93- 0
94- }
95- let totalvotes = (Previoustotalvotes + readA4AStakingAmount)
96- let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) {
97- case a: Int =>
98- a
99- case _ =>
100- 0
101- }
102- let ATVO = (FTVO + readA4AStakingAmount)
103- let PreviousUserCountforVoting = match getInteger(this, ((pubkey + "_") + toString(Porposal_ID))) {
104- case a: Int =>
105- a
106- case _ =>
107- 0
108- }
109- let LatestUserCountforVoting = (PreviousUserCountforVoting + 1)
110- if ((StartTS > lastBlock.timestamp))
111- then throw((launch_error + toString(StartTS)))
112- else if ((lastBlock.timestamp > EndTS))
113- then throw(voteErr)
114- else if ((readQuoraumValue > ATVO))
115- then [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Fail"), StringEntry("message", msg)]
116- else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Fail"), StringEntry("message", msg)]
77+ else if ((totalvotes > readQuoraumValue))
78+ then [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry(("Quorum_Status_" + toString(Porposal_ID)), "Pass"), StringEntry("message", msg)]
79+ else nil
11780 }
11881
11982
12083 @Verifier(tx)
12184 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
12285

github/deemru/w8io/169f3d6 
31.23 ms