tx · 9GUG1i1ArZyxxWj8skFjXRX3p3dmBVQvsXUByyhPEeVd 3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd: -0.01400000 Waves 2023.04.14 14:52 [2534173] smart account 3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd > SELF 0.00000000 Waves
{ "type": 13, "id": "9GUG1i1ArZyxxWj8skFjXRX3p3dmBVQvsXUByyhPEeVd", "fee": 1400000, "feeAssetId": null, "timestamp": 1681473148590, "version": 2, "chainId": 84, "sender": "3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd", "senderPublicKey": "AK6rRKpHobxNveEtJE5BBXbdwm9BpGL7ewP9Xb6VYuHx", "proofs": [ "2gAHLaFwNt8R4UxNFDKhjj27EbUAoXwPFApXZaCd4MPxMkkfUzgp2EGLVE23snRpxu9DVsaVJNPhmhTYKm6RiJGs" ], "script": "base64:AAIEAAAAAAAAABMIAhIFCgMIAQESAwoBARIDCgEBAAAABwAAAAAOQTRBU3Rha2luZ0RBcHAJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNONm9XTHlRWTJnTTdRVWtVdkJtZTFSRW5BNmQxVjd5M0FUAAAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AQAAACA7dEXxvlA55FKxmI42AI6/6uJD1h8gECoNXRixDQRDDAAAAAASY29udHJvbGxlcl9hZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AAAAAAxsYXVuY2hfZXJyb3ICAAAAJERhcHAgd2lsbCBzdGFydCBWb3RpbmcgYXQgVGltZXN0YW1wIAAAAAADbXNnAgAAAC48aDE+WW91ciBWb3RlIFN1Ym1pdHRlZCBTdWNjZXNzZnVsbHkhPC9oMT48YnI+AAAAABFBbHJlYWR5Vm90ZWRFcnJvcgIAAAA+VGhpcyBBZGR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ABBQAAABFBbHJlYWR5Vm90ZWRFcnJvcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxUb3RhbF9Wb3Rlc18JAAGkAAAAAQUAAAALUG9ycG9zYWxfSUQFAAAACnRvdGFsdm90ZXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABlRvdGFsXwUAAAAHVm90ZUFzdAIAAAABXwkAAaQAAAABBQAAAAtQb3Jwb3NhbF9JRAUAAAAEQVRWTwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAABnB1YmtleQIAAAABXwkAAaQAAAABBQAAAAtQb3Jwb3NhbF9JRAUAAAAYTGF0ZXN0VXNlckNvdW50Zm9yVm90aW5nCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAB21lc3NhZ2UFAAAAA21zZwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnTsnsw", "height": 2534173, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Zny72WieSVLqn7Ltpa5AifVrnB8iYsR12s7eQgMDSbC Next: 6cp8saB11g67dp49fW27R4gBva5SeV4LxwBqK8kbwGM7 Diff:
Old | New | Differences | |
---|---|---|---|
71 | 71 | then throw((launch_error + toString(StartTS))) | |
72 | 72 | else if ((lastBlock.timestamp > EndTS)) | |
73 | 73 | then throw(voteErr) | |
74 | - | else if ((readQuoraumValue > | |
74 | + | else if ((readQuoraumValue > ATVO)) | |
75 | 75 | 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 | 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 | 77 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let A4AStakingDApp = addressFromStringValue("3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT") | |
5 | 5 | ||
6 | 6 | let voting_timestamp_controller_pubkey = base58'515tSAyMUbAb8kKjcpGDpqALGfCgcwfWmWKKkcBKTcGB' | |
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 AlreadyVotedError = "This Address Already participated for Voting in this Proposal." | |
15 | 15 | ||
16 | 16 | let voteErr = "Voting is Over for this Dapp." | |
17 | 17 | ||
18 | 18 | @Callable(i) | |
19 | 19 | func SetVotingTimeStamps (Proposal,Voting_Start_TimeStamp,Voting_End_TimeStamp) = { | |
20 | 20 | let StartTS = Voting_Start_TimeStamp | |
21 | 21 | let EndTS = Voting_End_TimeStamp | |
22 | 22 | let readtotalStakedA4A = getIntegerValue(A4AStakingDApp, "Staked_Amount") | |
23 | 23 | let QuorumValue = fraction(readtotalStakedA4A, 1, 3) | |
24 | 24 | let pubkey = toBase58String(i.caller.bytes) | |
25 | 25 | let Previoustotalproposals = match getInteger(this, "Total_Proposals") { | |
26 | 26 | case a: Int => | |
27 | 27 | a | |
28 | 28 | case _ => | |
29 | 29 | 0 | |
30 | 30 | } | |
31 | 31 | let totalproposals = (Previoustotalproposals + 1) | |
32 | 32 | if ((size(Proposal) > 5100)) | |
33 | 33 | then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.") | |
34 | 34 | else if ((i.caller != controller_address)) | |
35 | 35 | then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it.")) | |
36 | 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)] | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func Yes (Porposal_ID) = { | |
43 | 43 | let VoteAst = "Yes" | |
44 | 44 | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
45 | 45 | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
46 | 46 | let pubkey = toBase58String(i.caller.bytes) | |
47 | 47 | let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.") | |
48 | 48 | let readQuoraumValue = getIntegerValue(this, ("Quorum_" + toString(Porposal_ID))) | |
49 | 49 | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
50 | 50 | case a: Int => | |
51 | 51 | a | |
52 | 52 | case _ => | |
53 | 53 | 0 | |
54 | 54 | } | |
55 | 55 | let totalvotes = (Previoustotalvotes + readA4AStakingAmount) | |
56 | 56 | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
57 | 57 | case a: Int => | |
58 | 58 | a | |
59 | 59 | case _ => | |
60 | 60 | 0 | |
61 | 61 | } | |
62 | 62 | let ATVO = (FTVO + readA4AStakingAmount) | |
63 | 63 | let PreviousUserCountforVoting = match getInteger(this, ((pubkey + "_") + toString(Porposal_ID))) { | |
64 | 64 | case a: Int => | |
65 | 65 | a | |
66 | 66 | case _ => | |
67 | 67 | 0 | |
68 | 68 | } | |
69 | 69 | let LatestUserCountforVoting = (PreviousUserCountforVoting + 1) | |
70 | 70 | if ((StartTS > lastBlock.timestamp)) | |
71 | 71 | then throw((launch_error + toString(StartTS))) | |
72 | 72 | else if ((lastBlock.timestamp > EndTS)) | |
73 | 73 | then throw(voteErr) | |
74 | - | else if ((readQuoraumValue > | |
74 | + | else if ((readQuoraumValue > ATVO)) | |
75 | 75 | 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 | 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 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | 81 | @Callable(i) | |
82 | 82 | func No (Porposal_ID) = { | |
83 | 83 | let VoteAst = "No" | |
84 | 84 | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
85 | 85 | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
86 | 86 | let pubkey = toBase58String(i.caller.bytes) | |
87 | 87 | let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.") | |
88 | 88 | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
89 | 89 | case a: Int => | |
90 | 90 | a | |
91 | 91 | case _ => | |
92 | 92 | 0 | |
93 | 93 | } | |
94 | 94 | let totalvotes = (Previoustotalvotes + readA4AStakingAmount) | |
95 | 95 | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
96 | 96 | case a: Int => | |
97 | 97 | a | |
98 | 98 | case _ => | |
99 | 99 | 0 | |
100 | 100 | } | |
101 | 101 | let ATVO = (FTVO + readA4AStakingAmount) | |
102 | 102 | let PreviousUserCountforVoting = match getInteger(this, ((pubkey + "_") + toString(Porposal_ID))) { | |
103 | 103 | case a: Int => | |
104 | 104 | a | |
105 | 105 | case _ => | |
106 | 106 | 0 | |
107 | 107 | } | |
108 | 108 | let LatestUserCountforVoting = (PreviousUserCountforVoting + 1) | |
109 | 109 | if ((StartTS > lastBlock.timestamp)) | |
110 | 110 | then throw((launch_error + toString(StartTS))) | |
111 | 111 | else if ((lastBlock.timestamp > EndTS)) | |
112 | 112 | then throw(voteErr) | |
113 | 113 | else if ((LatestUserCountforVoting > 1)) | |
114 | 114 | then throw(AlreadyVotedError) | |
115 | 115 | else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), IntegerEntry(((pubkey + "_") + toString(Porposal_ID)), LatestUserCountforVoting), StringEntry("message", msg)] | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | @Verifier(tx) | |
120 | 120 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
121 | 121 |
github/deemru/w8io/169f3d6 40.63 ms ◑