tx · DnpksS99tmhBCCDBaXXBU1ZJ4hBQ98wJSNYn5rmFg7Ld

3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT:  -0.03000000 Waves

2021.05.20 11:58 [1533789] smart account 3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT > SELF 0.00000000 Waves

{ "type": 13, "id": "DnpksS99tmhBCCDBaXXBU1ZJ4hBQ98wJSNYn5rmFg7Ld", "fee": 3000000, "feeAssetId": null, "timestamp": 1621501157998, "version": 2, "chainId": 84, "sender": "3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT", "senderPublicKey": "5CSJYiEQvEGm3vH52UCQRkmhw7TV5ZzRhWptXi2hjM7T", "proofs": [ "2QFFpPCokJcF194s8JWZB74jfKB9SBVCr9MmLEDJc4fXYrDkx6obeCefr4un6FqovC6p86bf4C6mFZ8Qr63CV4gp" ], "script": "base64:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAIAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADmlzV29ya2luZ0dyb3VwAAAAAQAAAAFhCQAAAAAAAAIJAQAAAAx0cnlHZ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AAAAEFAAAACXZvdGluZ0tleQQAAAAObmV3Vm90aW5nU3RhdGUJAABkAAAAAgUAAAALdm90aW5nU3RhdGUFAAAADHZvdGVWYWx1ZUludAQAAAAMbXdnU3RhdHVzVmFsCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACCQABLAAAAAICAAAAD2Rhb19td2dfbWVtYmVyXwUAAAAGY2FsbGVyAgAAAAdfc3RhdHVzAwkAAAAAAAACBQAAAAxtd2dTdGF0dXNWYWwCAAAACGFwcHJvdmVkAwkBAAAAHWlzTWVtYmVyc2hpcFZvdGVkRm9yQ2FuZGlkYXRlAAAAAgUAAAARbWVtYmVyc2hpcEFkZHJlc3MFAAAAEGNhbmRpZGF0ZUFkZHJlc3MJAAACAAAAAQkAASwAAAACAgAAAB9Zb3UgaGF2ZSBhbHJlYWR5IHZvdGVkLiBDYWxsZXIgBQAAAAZjYWxsZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAABFtZW1iZXJzaGlwQWRkcmVzcwIAAAAHX3ZvdGVkXwUAAAAQY2FuZGlkYXRlQWRkcmVzcwAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAJdm90aW5nS2V5BQAAAA5uZXdWb3RpbmdTdGF0ZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIdm90ZWRLZXkFAAAACHZvdGVkVmFsBQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAABtZb3UgaGF2ZSBubyByaWdodHMuIENhbGxlciAFAAAABmNhbGxlcgAAAAAVxt/T", "height": 1533789, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AKvtQWdNoihHmJfZxPyqaRkW2HsJ4yUccREPgNE4PP9m Next: Qi6YjdcN5N9KcyLFrL2wXvGrTmR5wczeWNH2e1BhcT7 Diff:
OldNewDifferences
3232 }
3333
3434
35-func i (j) = (a((("membership_" + toString(j)) + "_status")) == "approved")
35+func i (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved")
3636
3737
38-func k (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved")
38+func k (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved")
3939
4040
41-func l (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved")
41+func l (m,n) = (h(((m + "_voted_") + n)) > 0)
4242
4343
44-func m (n,o) = (h(((n + "_voted_") + o)) > 0)
45-
46-
47-func p () = {
44+func o () = {
4845 let c = {
4946 let d = getString(this, "dao_members")
5047 if ($isInstanceOf(d, "String"))
5855 }
5956
6057
61-func q (r) = if ((r == "like"))
58+func p (q) = if ((q == "like"))
6259 then 1
63- else if ((r == "dislike"))
60+ else if ((q == "dislike"))
6461 then -1
65- else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + r))
62+ else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + q))
6663
6764
68-@Callable(s)
65+@Callable(r)
6966 func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0))
7067 then throw("This user already exists")
7168 else {
72- let t = p()
73- let u = ((t + ";") + g)
74- let v = h("dao_members_size")
75- let w = (v + 1)
76- WriteSet([DataEntry((("dao_member_" + g) + "_status"), "propose"), DataEntry("dao_members", u), DataEntry("dao_members_size", w)])
69+ let s = o()
70+ let t = ((s + ";") + g)
71+ let u = h("dao_members_size")
72+ let v = (u + 1)
73+ WriteSet([DataEntry((("dao_member_" + g) + "_status"), "propose"), DataEntry("dao_members", t), DataEntry("dao_members_size", v)])
7774 }
7875
7976
8077
81-@Callable(s)
82-func mRejectDAOMember (g) = if (!(f(s.caller)))
78+@Callable(r)
79+func mRejectDAOMember (g) = if (!(f(r.caller)))
8380 then throw("access only to the DAO Manager")
8481 else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")])
8582
8683
8784
88-@Callable(s)
89-func mAddDAOMember (g) = if (!(f(s.caller)))
85+@Callable(r)
86+func mAddDAOMember (g) = if (!(f(r.caller)))
9087 then throw("access only to the DAO Manager")
9188 else {
92- let t = p()
93- let u = ((t + ";") + g)
94- let v = h("dao_members_size")
95- let w = (v + 1)
96- WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", u), DataEntry("dao_members_size", w)])
89+ let s = o()
90+ let t = ((s + ";") + g)
91+ let u = h("dao_members_size")
92+ let v = (u + 1)
93+ WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", t), DataEntry("dao_members_size", v)])
9794 }
9895
9996
10097
101-@Callable(s)
102-func mAddWorkingGroup (g) = if (!(f(s.caller)))
98+@Callable(r)
99+func mAddWorkingGroup (g) = if (!(f(r.caller)))
103100 then throw("access only to the DAO Manager")
104101 else {
105- let t = {
102+ let s = {
106103 let d = getString(this, "dao_wg_members")
107104 if ($isInstanceOf(d, "String"))
108105 then {
111108 }
112109 else ""
113110 }
114- let u = ((t + ";") + g)
115- let v = h("dao_wg_size")
116- let w = (v + 1)
117- WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", u), DataEntry("dao_wg_size", w)])
111+ let t = ((s + ";") + g)
112+ let u = h("dao_wg_size")
113+ let v = (u + 1)
114+ WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", t), DataEntry("dao_wg_size", v)])
118115 }
119116
120117
121118
122-@Callable(s)
123-func mAddMembershipWorkingGroup (g) = if (!(f(s.caller)))
119+@Callable(r)
120+func mAddMembershipWorkingGroup (g) = if (!(f(r.caller)))
124121 then throw("access only to the DAO Manager")
125122 else {
126- let t = {
123+ let s = {
127124 let d = getString(this, "dao_mwg_members")
128125 if ($isInstanceOf(d, "String"))
129126 then {
132129 }
133130 else ""
134131 }
135- let u = ((t + ";") + g)
136- let v = h("dao_mwg_size")
137- let w = (v + 1)
138- WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", u), DataEntry("dao_mwg_size", w)])
132+ let t = ((s + ";") + g)
133+ let u = h("dao_mwg_size")
134+ let v = (u + 1)
135+ WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", t), DataEntry("dao_mwg_size", v)])
139136 }
140137
141138
142139
143-@Callable(s)
144-func wmgMembershipVoteForDAOMember (o,x) = {
145- let n = toString(s.caller)
146- let y = q(x)
147- let z = (("dao_member_" + o) + "_vote")
148- let A = (("dao_member_" + o) + "_voted")
140+@Callable(r)
141+func wmgMembershipVoteForDAOMember (n,w) = {
142+ let x = toString(r.caller)
143+ let m = toString(r.caller)
144+ let y = p(w)
145+ let z = (("dao_member_" + n) + "_vote")
146+ let A = (("dao_member_" + n) + "_voted")
149147 let B = {
150148 let d = getString(this, A)
151149 if ($isInstanceOf(d, "String"))
157155 }
158156 let C = h(z)
159157 let D = (C + y)
160- if (i(s.caller))
161- then if (m(n, o))
162- then throw("You have already voted")
163- else WriteSet([DataEntry(((n + "_voted_") + o), 1), DataEntry(z, D), DataEntry(A, B)])
164- else throw("You have no rights")
158+ let E = a((("dao_mwg_member_" + x) + "_status"))
159+ if ((E == "approved"))
160+ then if (l(m, n))
161+ then throw(("You have already voted. Caller " + x))
162+ else WriteSet([DataEntry(((m + "_voted_") + n), 1), DataEntry(z, D), DataEntry(A, B)])
163+ else throw(("You have no rights. Caller " + x))
165164 }
166165
167166
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func a (b) = {
55 let c = {
66 let d = getString(this, b)
77 if ($isInstanceOf(d, "String"))
88 then {
99 let e = d
1010 e
1111 }
1212 else ""
1313 }
1414 c
1515 }
1616
1717
1818 func f (g) = (g == this)
1919
2020
2121 func h (b) = {
2222 let c = {
2323 let d = getInteger(this, b)
2424 if ($isInstanceOf(d, "Int"))
2525 then {
2626 let e = d
2727 e
2828 }
2929 else 0
3030 }
3131 c
3232 }
3333
3434
35-func i (j) = (a((("membership_" + toString(j)) + "_status")) == "approved")
35+func i (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved")
3636
3737
38-func k (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved")
38+func k (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved")
3939
4040
41-func l (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved")
41+func l (m,n) = (h(((m + "_voted_") + n)) > 0)
4242
4343
44-func m (n,o) = (h(((n + "_voted_") + o)) > 0)
45-
46-
47-func p () = {
44+func o () = {
4845 let c = {
4946 let d = getString(this, "dao_members")
5047 if ($isInstanceOf(d, "String"))
5148 then {
5249 let e = d
5350 e
5451 }
5552 else ""
5653 }
5754 c
5855 }
5956
6057
61-func q (r) = if ((r == "like"))
58+func p (q) = if ((q == "like"))
6259 then 1
63- else if ((r == "dislike"))
60+ else if ((q == "dislike"))
6461 then -1
65- else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + r))
62+ else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + q))
6663
6764
68-@Callable(s)
65+@Callable(r)
6966 func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0))
7067 then throw("This user already exists")
7168 else {
72- let t = p()
73- let u = ((t + ";") + g)
74- let v = h("dao_members_size")
75- let w = (v + 1)
76- WriteSet([DataEntry((("dao_member_" + g) + "_status"), "propose"), DataEntry("dao_members", u), DataEntry("dao_members_size", w)])
69+ let s = o()
70+ let t = ((s + ";") + g)
71+ let u = h("dao_members_size")
72+ let v = (u + 1)
73+ WriteSet([DataEntry((("dao_member_" + g) + "_status"), "propose"), DataEntry("dao_members", t), DataEntry("dao_members_size", v)])
7774 }
7875
7976
8077
81-@Callable(s)
82-func mRejectDAOMember (g) = if (!(f(s.caller)))
78+@Callable(r)
79+func mRejectDAOMember (g) = if (!(f(r.caller)))
8380 then throw("access only to the DAO Manager")
8481 else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")])
8582
8683
8784
88-@Callable(s)
89-func mAddDAOMember (g) = if (!(f(s.caller)))
85+@Callable(r)
86+func mAddDAOMember (g) = if (!(f(r.caller)))
9087 then throw("access only to the DAO Manager")
9188 else {
92- let t = p()
93- let u = ((t + ";") + g)
94- let v = h("dao_members_size")
95- let w = (v + 1)
96- WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", u), DataEntry("dao_members_size", w)])
89+ let s = o()
90+ let t = ((s + ";") + g)
91+ let u = h("dao_members_size")
92+ let v = (u + 1)
93+ WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", t), DataEntry("dao_members_size", v)])
9794 }
9895
9996
10097
101-@Callable(s)
102-func mAddWorkingGroup (g) = if (!(f(s.caller)))
98+@Callable(r)
99+func mAddWorkingGroup (g) = if (!(f(r.caller)))
103100 then throw("access only to the DAO Manager")
104101 else {
105- let t = {
102+ let s = {
106103 let d = getString(this, "dao_wg_members")
107104 if ($isInstanceOf(d, "String"))
108105 then {
109106 let e = d
110107 e
111108 }
112109 else ""
113110 }
114- let u = ((t + ";") + g)
115- let v = h("dao_wg_size")
116- let w = (v + 1)
117- WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", u), DataEntry("dao_wg_size", w)])
111+ let t = ((s + ";") + g)
112+ let u = h("dao_wg_size")
113+ let v = (u + 1)
114+ WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", t), DataEntry("dao_wg_size", v)])
118115 }
119116
120117
121118
122-@Callable(s)
123-func mAddMembershipWorkingGroup (g) = if (!(f(s.caller)))
119+@Callable(r)
120+func mAddMembershipWorkingGroup (g) = if (!(f(r.caller)))
124121 then throw("access only to the DAO Manager")
125122 else {
126- let t = {
123+ let s = {
127124 let d = getString(this, "dao_mwg_members")
128125 if ($isInstanceOf(d, "String"))
129126 then {
130127 let e = d
131128 e
132129 }
133130 else ""
134131 }
135- let u = ((t + ";") + g)
136- let v = h("dao_mwg_size")
137- let w = (v + 1)
138- WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", u), DataEntry("dao_mwg_size", w)])
132+ let t = ((s + ";") + g)
133+ let u = h("dao_mwg_size")
134+ let v = (u + 1)
135+ WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", t), DataEntry("dao_mwg_size", v)])
139136 }
140137
141138
142139
143-@Callable(s)
144-func wmgMembershipVoteForDAOMember (o,x) = {
145- let n = toString(s.caller)
146- let y = q(x)
147- let z = (("dao_member_" + o) + "_vote")
148- let A = (("dao_member_" + o) + "_voted")
140+@Callable(r)
141+func wmgMembershipVoteForDAOMember (n,w) = {
142+ let x = toString(r.caller)
143+ let m = toString(r.caller)
144+ let y = p(w)
145+ let z = (("dao_member_" + n) + "_vote")
146+ let A = (("dao_member_" + n) + "_voted")
149147 let B = {
150148 let d = getString(this, A)
151149 if ($isInstanceOf(d, "String"))
152150 then {
153151 let e = d
154152 e
155153 }
156154 else ""
157155 }
158156 let C = h(z)
159157 let D = (C + y)
160- if (i(s.caller))
161- then if (m(n, o))
162- then throw("You have already voted")
163- else WriteSet([DataEntry(((n + "_voted_") + o), 1), DataEntry(z, D), DataEntry(A, B)])
164- else throw("You have no rights")
158+ let E = a((("dao_mwg_member_" + x) + "_status"))
159+ if ((E == "approved"))
160+ then if (l(m, n))
161+ then throw(("You have already voted. Caller " + x))
162+ else WriteSet([DataEntry(((m + "_voted_") + n), 1), DataEntry(z, D), DataEntry(A, B)])
163+ else throw(("You have no rights. Caller " + x))
165164 }
166165
167166

github/deemru/w8io/169f3d6 
72.95 ms