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+PGJyPgAAAAARQWxyZWFkeVZvdGVkRXJyb3ICAAAAPlRoaXMgQWRkcmVzcy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x1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxUb3RhbF9Wb3Rlc18JAAGkAAAAAQUAAAALUG9ycG9zYWxfSUQFAAAACnRvdGFsdm90ZXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABlRvdGFsXwUAAAAHVm90ZUFzdAIAAAABXwkAAaQAAAABBQAAAAtQb3Jwb3NhbF9JRAUAAAAEQVRWTwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAABnB1YmtleQIAAAABXwkAAaQAAAABBQAAAAtQb3Jwb3NhbF9JRAUAAAAYTGF0ZXN0VXNlckNvdW50Zm9yVm90aW5nCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAOUXVvcnVtX1N0YXR1c18JAAGkAAAAAQUAAAALUG9ycG9zYWxfSUQCAAAABFBhc3MJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAHbWVzc2FnZQUAAAADbXNnBQAAAANuaWwFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5olhAzw==", "height": 2534280, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6cp8saB11g67dp49fW27R4gBva5SeV4LxwBqK8kbwGM7 Next: 2yWDvu2q89GZkxDJoydYDbAucwZ2uuCBLscrP3Lte5YY Diff:
Old | New | Differences | |
---|---|---|---|
36 | 36 | then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.") | |
37 | 37 | else if ((h.caller != c)) | |
38 | 38 | then throw((("This Address is not Authorized. Only " + toString(c)) + " is Authorized Address to Sign it.")) | |
39 | - | else [StringEntry(("Proposal_Text_" + toString(t)), i), IntegerEntry("Total_Proposals", t), StringEntry(("Proposer_" + toString(t)), p), IntegerEntry(("Voting_Start_TimeStamp_" + toString(t)), l), IntegerEntry(("Voting_End_TimeStamp_" + toString(t)), m), IntegerEntry(("Quorum_" + toString(t)), o), IntegerEntry(("Total_Votes_" + toString(t)), 0), IntegerEntry(("Total_No_" + toString(t)), 0), IntegerEntry(("Total_Yes_" + toString(t)), 0)] | |
39 | + | else [StringEntry(("Proposal_Text_" + toString(t)), i), IntegerEntry("Total_Proposals", t), StringEntry(("Proposer_" + toString(t)), p), IntegerEntry(("Voting_Start_TimeStamp_" + toString(t)), l), IntegerEntry(("Voting_End_TimeStamp_" + toString(t)), m), IntegerEntry(("Quorum_" + toString(t)), o), IntegerEntry(("Total_Votes_" + toString(t)), 0), IntegerEntry(("Total_No_" + toString(t)), 0), IntegerEntry(("Total_Yes_" + toString(t)), 0), StringEntry(("Quorum_Status_" + toString(t)), "Fail")] | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
49 | 49 | let p = toBase58String(h.caller.bytes) | |
50 | 50 | let w = valueOrErrorMessage(getInteger(a, ("Deposit_Amount_Of_" + p)), "Address not found in A4A Staking.") | |
51 | 51 | let x = getIntegerValue(this, ("Quorum_" + toString(u))) | |
52 | - | let y = { | |
52 | + | let y = getIntegerValue(this, ("Total_No_" + toString(u))) | |
53 | + | let z = { | |
53 | 54 | let r = getInteger(this, ("Total_Votes_" + toString(u))) | |
54 | 55 | if ($isInstanceOf(r, "Int")) | |
55 | 56 | then { | |
58 | 59 | } | |
59 | 60 | else 0 | |
60 | 61 | } | |
61 | - | let | |
62 | - | let | |
62 | + | let A = (z + w) | |
63 | + | let B = { | |
63 | 64 | let r = getInteger(this, ((("Total_" + v) + "_") + toString(u))) | |
64 | 65 | if ($isInstanceOf(r, "Int")) | |
65 | 66 | then { | |
68 | 69 | } | |
69 | 70 | else 0 | |
70 | 71 | } | |
71 | - | let | |
72 | - | let | |
72 | + | let C = (B + w) | |
73 | + | let D = { | |
73 | 74 | let r = getInteger(this, ((p + "_") + toString(u))) | |
74 | 75 | if ($isInstanceOf(r, "Int")) | |
75 | 76 | then { | |
78 | 79 | } | |
79 | 80 | else 0 | |
80 | 81 | } | |
81 | - | let | |
82 | + | let E = (D + 1) | |
82 | 83 | if ((l > lastBlock.timestamp)) | |
83 | 84 | then throw((d + toString(l))) | |
84 | 85 | else if ((lastBlock.timestamp > m)) | |
85 | 86 | then throw(g) | |
86 | - | else if ((x > B)) | |
87 | - | then [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
88 | - | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Pass"), StringEntry("message", e)] | |
87 | + | else if ((x > A)) | |
88 | + | then [IntegerEntry(("Total_Votes_" + toString(u)), A), IntegerEntry(((("Total_" + v) + "_") + toString(u)), C), IntegerEntry(((p + "_") + toString(u)), E), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
89 | + | else if ((A > x)) | |
90 | + | then [IntegerEntry(("Total_Votes_" + toString(u)), A), IntegerEntry(((("Total_" + v) + "_") + toString(u)), C), IntegerEntry(((p + "_") + toString(u)), E), StringEntry(("Quorum_Status_" + toString(u)), "Pass"), StringEntry("message", e)] | |
91 | + | else nil | |
89 | 92 | } | |
90 | 93 | ||
91 | 94 | ||
92 | - | ||
93 | - | @Callable(h) | |
94 | - | func No (u) = { | |
95 | - | let v = "No" | |
96 | - | let l = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(u))) | |
97 | - | let m = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(u))) | |
98 | - | let p = toBase58String(h.caller.bytes) | |
99 | - | let w = valueOrErrorMessage(getInteger(a, ("Deposit_Amount_Of_" + p)), "Address not found in A4A Staking.") | |
100 | - | let x = getIntegerValue(this, ("Quorum_" + toString(u))) | |
101 | - | let y = { | |
102 | - | let r = getInteger(this, ("Total_Votes_" + toString(u))) | |
103 | - | if ($isInstanceOf(r, "Int")) | |
104 | - | then { | |
105 | - | let s = r | |
106 | - | s | |
107 | - | } | |
108 | - | else 0 | |
109 | - | } | |
110 | - | let z = (y + w) | |
111 | - | let A = { | |
112 | - | let r = getInteger(this, ((("Total_" + v) + "_") + toString(u))) | |
113 | - | if ($isInstanceOf(r, "Int")) | |
114 | - | then { | |
115 | - | let s = r | |
116 | - | s | |
117 | - | } | |
118 | - | else 0 | |
119 | - | } | |
120 | - | let B = (A + w) | |
121 | - | let C = { | |
122 | - | let r = getInteger(this, ((p + "_") + toString(u))) | |
123 | - | if ($isInstanceOf(r, "Int")) | |
124 | - | then { | |
125 | - | let s = r | |
126 | - | s | |
127 | - | } | |
128 | - | else 0 | |
129 | - | } | |
130 | - | let D = (C + 1) | |
131 | - | if ((l > lastBlock.timestamp)) | |
132 | - | then throw((d + toString(l))) | |
133 | - | else if ((lastBlock.timestamp > m)) | |
134 | - | then throw(g) | |
135 | - | else if ((x > B)) | |
136 | - | then [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
137 | - | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
138 | - | } | |
139 | - | ||
140 | - | ||
141 | - | @Verifier(E) | |
142 | - | func F () = sigVerify(E.bodyBytes, E.proofs[0], E.senderPublicKey) | |
95 | + | @Verifier(F) | |
96 | + | func G () = sigVerify(F.bodyBytes, F.proofs[0], F.senderPublicKey) | |
143 | 97 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = addressFromStringValue("3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT") | |
5 | 5 | ||
6 | 6 | let b = base58'515tSAyMUbAb8kKjcpGDpqALGfCgcwfWmWKKkcBKTcGB' | |
7 | 7 | ||
8 | 8 | let c = addressFromPublicKey(b) | |
9 | 9 | ||
10 | 10 | let d = "Dapp will start Voting at Timestamp " | |
11 | 11 | ||
12 | 12 | let e = "<h1>Your Vote Submitted Successfully!</h1><br>" | |
13 | 13 | ||
14 | 14 | let f = "This Address Already participated for Voting in this Proposal." | |
15 | 15 | ||
16 | 16 | let g = "Voting is Over for this Dapp." | |
17 | 17 | ||
18 | 18 | @Callable(h) | |
19 | 19 | func SetVotingTimeStamps (i,j,k) = { | |
20 | 20 | let l = j | |
21 | 21 | let m = k | |
22 | 22 | let n = getIntegerValue(a, "Staked_Amount") | |
23 | 23 | let o = fraction(n, 1, 3) | |
24 | 24 | let p = toBase58String(h.caller.bytes) | |
25 | 25 | let q = { | |
26 | 26 | let r = getInteger(this, "Total_Proposals") | |
27 | 27 | if ($isInstanceOf(r, "Int")) | |
28 | 28 | then { | |
29 | 29 | let s = r | |
30 | 30 | s | |
31 | 31 | } | |
32 | 32 | else 0 | |
33 | 33 | } | |
34 | 34 | let t = (q + 1) | |
35 | 35 | if ((size(i) > 5100)) | |
36 | 36 | then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.") | |
37 | 37 | else if ((h.caller != c)) | |
38 | 38 | then throw((("This Address is not Authorized. Only " + toString(c)) + " is Authorized Address to Sign it.")) | |
39 | - | else [StringEntry(("Proposal_Text_" + toString(t)), i), IntegerEntry("Total_Proposals", t), StringEntry(("Proposer_" + toString(t)), p), IntegerEntry(("Voting_Start_TimeStamp_" + toString(t)), l), IntegerEntry(("Voting_End_TimeStamp_" + toString(t)), m), IntegerEntry(("Quorum_" + toString(t)), o), IntegerEntry(("Total_Votes_" + toString(t)), 0), IntegerEntry(("Total_No_" + toString(t)), 0), IntegerEntry(("Total_Yes_" + toString(t)), 0)] | |
39 | + | else [StringEntry(("Proposal_Text_" + toString(t)), i), IntegerEntry("Total_Proposals", t), StringEntry(("Proposer_" + toString(t)), p), IntegerEntry(("Voting_Start_TimeStamp_" + toString(t)), l), IntegerEntry(("Voting_End_TimeStamp_" + toString(t)), m), IntegerEntry(("Quorum_" + toString(t)), o), IntegerEntry(("Total_Votes_" + toString(t)), 0), IntegerEntry(("Total_No_" + toString(t)), 0), IntegerEntry(("Total_Yes_" + toString(t)), 0), StringEntry(("Quorum_Status_" + toString(t)), "Fail")] | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(h) | |
45 | 45 | func Yes (u) = { | |
46 | 46 | let v = "Yes" | |
47 | 47 | let l = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(u))) | |
48 | 48 | let m = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(u))) | |
49 | 49 | let p = toBase58String(h.caller.bytes) | |
50 | 50 | let w = valueOrErrorMessage(getInteger(a, ("Deposit_Amount_Of_" + p)), "Address not found in A4A Staking.") | |
51 | 51 | let x = getIntegerValue(this, ("Quorum_" + toString(u))) | |
52 | - | let y = { | |
52 | + | let y = getIntegerValue(this, ("Total_No_" + toString(u))) | |
53 | + | let z = { | |
53 | 54 | let r = getInteger(this, ("Total_Votes_" + toString(u))) | |
54 | 55 | if ($isInstanceOf(r, "Int")) | |
55 | 56 | then { | |
56 | 57 | let s = r | |
57 | 58 | s | |
58 | 59 | } | |
59 | 60 | else 0 | |
60 | 61 | } | |
61 | - | let | |
62 | - | let | |
62 | + | let A = (z + w) | |
63 | + | let B = { | |
63 | 64 | let r = getInteger(this, ((("Total_" + v) + "_") + toString(u))) | |
64 | 65 | if ($isInstanceOf(r, "Int")) | |
65 | 66 | then { | |
66 | 67 | let s = r | |
67 | 68 | s | |
68 | 69 | } | |
69 | 70 | else 0 | |
70 | 71 | } | |
71 | - | let | |
72 | - | let | |
72 | + | let C = (B + w) | |
73 | + | let D = { | |
73 | 74 | let r = getInteger(this, ((p + "_") + toString(u))) | |
74 | 75 | if ($isInstanceOf(r, "Int")) | |
75 | 76 | then { | |
76 | 77 | let s = r | |
77 | 78 | s | |
78 | 79 | } | |
79 | 80 | else 0 | |
80 | 81 | } | |
81 | - | let | |
82 | + | let E = (D + 1) | |
82 | 83 | if ((l > lastBlock.timestamp)) | |
83 | 84 | then throw((d + toString(l))) | |
84 | 85 | else if ((lastBlock.timestamp > m)) | |
85 | 86 | then throw(g) | |
86 | - | else if ((x > B)) | |
87 | - | then [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
88 | - | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Pass"), StringEntry("message", e)] | |
87 | + | else if ((x > A)) | |
88 | + | then [IntegerEntry(("Total_Votes_" + toString(u)), A), IntegerEntry(((("Total_" + v) + "_") + toString(u)), C), IntegerEntry(((p + "_") + toString(u)), E), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
89 | + | else if ((A > x)) | |
90 | + | then [IntegerEntry(("Total_Votes_" + toString(u)), A), IntegerEntry(((("Total_" + v) + "_") + toString(u)), C), IntegerEntry(((p + "_") + toString(u)), E), StringEntry(("Quorum_Status_" + toString(u)), "Pass"), StringEntry("message", e)] | |
91 | + | else nil | |
89 | 92 | } | |
90 | 93 | ||
91 | 94 | ||
92 | - | ||
93 | - | @Callable(h) | |
94 | - | func No (u) = { | |
95 | - | let v = "No" | |
96 | - | let l = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(u))) | |
97 | - | let m = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(u))) | |
98 | - | let p = toBase58String(h.caller.bytes) | |
99 | - | let w = valueOrErrorMessage(getInteger(a, ("Deposit_Amount_Of_" + p)), "Address not found in A4A Staking.") | |
100 | - | let x = getIntegerValue(this, ("Quorum_" + toString(u))) | |
101 | - | let y = { | |
102 | - | let r = getInteger(this, ("Total_Votes_" + toString(u))) | |
103 | - | if ($isInstanceOf(r, "Int")) | |
104 | - | then { | |
105 | - | let s = r | |
106 | - | s | |
107 | - | } | |
108 | - | else 0 | |
109 | - | } | |
110 | - | let z = (y + w) | |
111 | - | let A = { | |
112 | - | let r = getInteger(this, ((("Total_" + v) + "_") + toString(u))) | |
113 | - | if ($isInstanceOf(r, "Int")) | |
114 | - | then { | |
115 | - | let s = r | |
116 | - | s | |
117 | - | } | |
118 | - | else 0 | |
119 | - | } | |
120 | - | let B = (A + w) | |
121 | - | let C = { | |
122 | - | let r = getInteger(this, ((p + "_") + toString(u))) | |
123 | - | if ($isInstanceOf(r, "Int")) | |
124 | - | then { | |
125 | - | let s = r | |
126 | - | s | |
127 | - | } | |
128 | - | else 0 | |
129 | - | } | |
130 | - | let D = (C + 1) | |
131 | - | if ((l > lastBlock.timestamp)) | |
132 | - | then throw((d + toString(l))) | |
133 | - | else if ((lastBlock.timestamp > m)) | |
134 | - | then throw(g) | |
135 | - | else if ((x > B)) | |
136 | - | then [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
137 | - | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_" + v) + "_") + toString(u)), B), IntegerEntry(((p + "_") + toString(u)), D), StringEntry(("Quorum_Status_" + toString(u)), "Fail"), StringEntry("message", e)] | |
138 | - | } | |
139 | - | ||
140 | - | ||
141 | - | @Verifier(E) | |
142 | - | func F () = sigVerify(E.bodyBytes, E.proofs[0], E.senderPublicKey) | |
95 | + | @Verifier(F) | |
96 | + | func G () = sigVerify(F.bodyBytes, F.proofs[0], F.senderPublicKey) | |
143 | 97 |
github/deemru/w8io/169f3d6 47.38 ms ◑