tx · 3Vczk9k5BYTDuyMTMvwkxEu2p5BXdTavJ1FoUaKU2VHk
3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT: -0.01600000 Waves
2021.05.20 14:18 [1533932] smart account 3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT > SELF 0.00000000 Waves
{
"type": 13,
"id": "3Vczk9k5BYTDuyMTMvwkxEu2p5BXdTavJ1FoUaKU2VHk",
"fee": 1600000,
"feeAssetId": null,
"timestamp": 1621509507573,
"version": 2,
"chainId": 84,
"sender": "3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT",
"senderPublicKey": "5CSJYiEQvEGm3vH52UCQRkmhw7TV5ZzRhWptXi2hjM7T",
"proofs": [
"3WF2mT25YVKhPLNM3Ve5sTcRNsPhLZ23KbNGVzmjzXWs5tpAjmhXqyzx8HUnbj5qrxSkbaPeyUNZUPAFyEaPDHAT"
],
"script": "base64:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAHAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADmlzV29ya2luZ0dyb3VwAAAAAQAAAAFhCQAAAAAAA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V5BAAAAA5uZXdWb3RpbmdTdGF0ZQkAAGQAAAACBQAAAAt2b3RpbmdTdGF0ZQUAAAAMdm90ZVZhbHVlSW50BAAAAAxtd2dTdGF0dXNWYWwJAQAAAAx0cnlHZXRTdHJpbmcAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAPZGFvX213Z19tZW1iZXJfBQAAAAZjYWxsZXICAAAAB19zdGF0dXMDCQAAAAAAAAIFAAAADG13Z1N0YXR1c1ZhbAIAAAAIYXBwcm92ZWQDCQAAZgAAAAIJAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAALZGFvX21lbWJlcl8FAAAAEGNhbmRpZGF0ZUFkZHJlc3MCAAAAB192b3Rlc18FAAAABmNhbGxlcgAAAAAAAAAAAAkAAAIAAAABCQABLAAAAAICAAAAH1lvdSBoYXZlIGFscmVhZHkgdm90ZWQuIENhbGxlciAFAAAABmNhbGxlcgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAJdm90aW5nS2V5BQAAAA5uZXdWb3RpbmdTdGF0ZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIdm90ZWRLZXkFAAAAC25ld1ZvdGVkVmFsCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAh2b3Rlc0tleQUAAAAMdm90ZVZhbHVlSW50BQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAABtZb3UgaGF2ZSBubyByaWdodHMuIENhbGxlciAFAAAABmNhbGxlcgAAAACnqGtt",
"height": 1533932,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Qi6YjdcN5N9KcyLFrL2wXvGrTmR5wczeWNH2e1BhcT7
Next: 45wYiWKPL6oEZ4bkbGpGGM5VuAwxqJPAJ9nJeNqCQK2Y
Diff:
Old | New | | Differences |
---|
38 | 38 | | func k (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved") |
---|
39 | 39 | | |
---|
40 | 40 | | |
---|
41 | | - | func l (m,n) = (h(((m + "_voted_") + n)) > 0) |
---|
42 | | - | |
---|
43 | | - | |
---|
44 | | - | func o () = { |
---|
| 41 | + | func l () = { |
---|
45 | 42 | | let c = { |
---|
46 | 43 | | let d = getString(this, "dao_members") |
---|
47 | 44 | | if ($isInstanceOf(d, "String")) |
---|
|
55 | 52 | | } |
---|
56 | 53 | | |
---|
57 | 54 | | |
---|
58 | | - | func p (q) = if ((q == "like")) |
---|
| 55 | + | func m (n) = if ((n == "like")) |
---|
59 | 56 | | then 1 |
---|
60 | | - | else if ((q == "dislike")) |
---|
| 57 | + | else if ((n == "dislike")) |
---|
61 | 58 | | then -1 |
---|
62 | | - | else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + q)) |
---|
| 59 | + | else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + n)) |
---|
63 | 60 | | |
---|
64 | 61 | | |
---|
65 | | - | @Callable(r) |
---|
| 62 | + | @Callable(o) |
---|
66 | 63 | | func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0)) |
---|
67 | 64 | | then throw("This user already exists") |
---|
68 | 65 | | else { |
---|
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)]) |
---|
| 66 | + | let p = l() |
---|
| 67 | + | let q = ((p + ";") + g) |
---|
| 68 | + | let r = h("dao_members_size") |
---|
| 69 | + | let s = (r + 1) |
---|
| 70 | + | WriteSet([DataEntry((("dao_member_" + g) + "_status"), "propose"), DataEntry("dao_members", q), DataEntry("dao_members_size", s)]) |
---|
74 | 71 | | } |
---|
75 | 72 | | |
---|
76 | 73 | | |
---|
77 | 74 | | |
---|
78 | | - | @Callable(r) |
---|
79 | | - | func mRejectDAOMember (g) = if (!(f(r.caller))) |
---|
| 75 | + | @Callable(o) |
---|
| 76 | + | func mRejectDAOMember (g) = if (!(f(o.caller))) |
---|
80 | 77 | | then throw("access only to the DAO Manager") |
---|
81 | 78 | | else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")]) |
---|
82 | 79 | | |
---|
83 | 80 | | |
---|
84 | 81 | | |
---|
85 | | - | @Callable(r) |
---|
86 | | - | func mAddDAOMember (g) = if (!(f(r.caller))) |
---|
| 82 | + | @Callable(o) |
---|
| 83 | + | func mAddDAOMember (g) = if (!(f(o.caller))) |
---|
87 | 84 | | then throw("access only to the DAO Manager") |
---|
88 | 85 | | else { |
---|
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)]) |
---|
| 86 | + | let p = l() |
---|
| 87 | + | let q = ((p + ";") + g) |
---|
| 88 | + | let r = h("dao_members_size") |
---|
| 89 | + | let s = (r + 1) |
---|
| 90 | + | WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", q), DataEntry("dao_members_size", s)]) |
---|
94 | 91 | | } |
---|
95 | 92 | | |
---|
96 | 93 | | |
---|
97 | 94 | | |
---|
98 | | - | @Callable(r) |
---|
99 | | - | func mAddWorkingGroup (g) = if (!(f(r.caller))) |
---|
| 95 | + | @Callable(o) |
---|
| 96 | + | func mAddWorkingGroup (g) = if (!(f(o.caller))) |
---|
100 | 97 | | then throw("access only to the DAO Manager") |
---|
101 | 98 | | else { |
---|
102 | | - | let s = { |
---|
| 99 | + | let p = { |
---|
103 | 100 | | let d = getString(this, "dao_wg_members") |
---|
104 | 101 | | if ($isInstanceOf(d, "String")) |
---|
105 | 102 | | then { |
---|
|
108 | 105 | | } |
---|
109 | 106 | | else "" |
---|
110 | 107 | | } |
---|
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)]) |
---|
| 108 | + | let q = ((p + ";") + g) |
---|
| 109 | + | let r = h("dao_wg_size") |
---|
| 110 | + | let s = (r + 1) |
---|
| 111 | + | WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", q), DataEntry("dao_wg_size", s)]) |
---|
115 | 112 | | } |
---|
116 | 113 | | |
---|
117 | 114 | | |
---|
118 | 115 | | |
---|
119 | | - | @Callable(r) |
---|
120 | | - | func mAddMembershipWorkingGroup (g) = if (!(f(r.caller))) |
---|
| 116 | + | @Callable(o) |
---|
| 117 | + | func mAddMembershipWorkingGroup (g) = if (!(f(o.caller))) |
---|
121 | 118 | | then throw("access only to the DAO Manager") |
---|
122 | 119 | | else { |
---|
123 | | - | let s = { |
---|
| 120 | + | let p = { |
---|
124 | 121 | | let d = getString(this, "dao_mwg_members") |
---|
125 | 122 | | if ($isInstanceOf(d, "String")) |
---|
126 | 123 | | then { |
---|
|
129 | 126 | | } |
---|
130 | 127 | | else "" |
---|
131 | 128 | | } |
---|
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)]) |
---|
| 129 | + | let q = ((p + ";") + g) |
---|
| 130 | + | let r = h("dao_mwg_size") |
---|
| 131 | + | let s = (r + 1) |
---|
| 132 | + | WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", q), DataEntry("dao_mwg_size", s)]) |
---|
136 | 133 | | } |
---|
137 | 134 | | |
---|
138 | 135 | | |
---|
139 | 136 | | |
---|
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") |
---|
| 137 | + | @Callable(o) |
---|
| 138 | + | func wmgMembershipVoteForDAOMember (t,u) = { |
---|
| 139 | + | let v = toString(o.caller) |
---|
| 140 | + | let w = toString(o.caller) |
---|
| 141 | + | let x = m(u) |
---|
| 142 | + | let y = (("dao_member_" + t) + "_vote") |
---|
| 143 | + | let z = (("dao_member_" + t) + "_voted") |
---|
| 144 | + | let A = ((("dao_member_" + t) + "_votes_") + v) |
---|
147 | 145 | | let B = { |
---|
148 | | - | let d = getString(this, A) |
---|
| 146 | + | let d = getString(this, z) |
---|
149 | 147 | | if ($isInstanceOf(d, "String")) |
---|
150 | 148 | | then { |
---|
151 | 149 | | let e = d |
---|
|
153 | 151 | | } |
---|
154 | 152 | | else "" |
---|
155 | 153 | | } |
---|
156 | | - | let C = ((x + ";") + B) |
---|
157 | | - | let D = h(z) |
---|
158 | | - | let E = (D + y) |
---|
159 | | - | let F = a((("dao_mwg_member_" + x) + "_status")) |
---|
| 154 | + | let C = ((v + ";") + B) |
---|
| 155 | + | let D = h(y) |
---|
| 156 | + | let E = (D + x) |
---|
| 157 | + | let F = a((("dao_mwg_member_" + v) + "_status")) |
---|
160 | 158 | | if ((F == "approved")) |
---|
161 | | - | then if (l(m, n)) |
---|
162 | | - | then throw(("You have already voted. Caller " + x)) |
---|
163 | | - | else WriteSet([DataEntry(((m + "_voted_") + n), 1), DataEntry(z, E), DataEntry(A, C)]) |
---|
164 | | - | else throw(("You have no rights. Caller " + x)) |
---|
| 159 | + | then if ((h(((("dao_member_" + t) + "_votes_") + v)) > 0)) |
---|
| 160 | + | then throw(("You have already voted. Caller " + v)) |
---|
| 161 | + | else WriteSet([DataEntry(y, E), DataEntry(z, C), DataEntry(A, x)]) |
---|
| 162 | + | else throw(("You have no rights. Caller " + v)) |
---|
165 | 163 | | } |
---|
166 | 164 | | |
---|
167 | 165 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func a (b) = { |
---|
5 | 5 | | let c = { |
---|
6 | 6 | | let d = getString(this, b) |
---|
7 | 7 | | if ($isInstanceOf(d, "String")) |
---|
8 | 8 | | then { |
---|
9 | 9 | | let e = d |
---|
10 | 10 | | e |
---|
11 | 11 | | } |
---|
12 | 12 | | else "" |
---|
13 | 13 | | } |
---|
14 | 14 | | c |
---|
15 | 15 | | } |
---|
16 | 16 | | |
---|
17 | 17 | | |
---|
18 | 18 | | func f (g) = (g == this) |
---|
19 | 19 | | |
---|
20 | 20 | | |
---|
21 | 21 | | func h (b) = { |
---|
22 | 22 | | let c = { |
---|
23 | 23 | | let d = getInteger(this, b) |
---|
24 | 24 | | if ($isInstanceOf(d, "Int")) |
---|
25 | 25 | | then { |
---|
26 | 26 | | let e = d |
---|
27 | 27 | | e |
---|
28 | 28 | | } |
---|
29 | 29 | | else 0 |
---|
30 | 30 | | } |
---|
31 | 31 | | c |
---|
32 | 32 | | } |
---|
33 | 33 | | |
---|
34 | 34 | | |
---|
35 | 35 | | func i (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved") |
---|
36 | 36 | | |
---|
37 | 37 | | |
---|
38 | 38 | | func k (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved") |
---|
39 | 39 | | |
---|
40 | 40 | | |
---|
41 | | - | func l (m,n) = (h(((m + "_voted_") + n)) > 0) |
---|
42 | | - | |
---|
43 | | - | |
---|
44 | | - | func o () = { |
---|
| 41 | + | func l () = { |
---|
45 | 42 | | let c = { |
---|
46 | 43 | | let d = getString(this, "dao_members") |
---|
47 | 44 | | if ($isInstanceOf(d, "String")) |
---|
48 | 45 | | then { |
---|
49 | 46 | | let e = d |
---|
50 | 47 | | e |
---|
51 | 48 | | } |
---|
52 | 49 | | else "" |
---|
53 | 50 | | } |
---|
54 | 51 | | c |
---|
55 | 52 | | } |
---|
56 | 53 | | |
---|
57 | 54 | | |
---|
58 | | - | func p (q) = if ((q == "like")) |
---|
| 55 | + | func m (n) = if ((n == "like")) |
---|
59 | 56 | | then 1 |
---|
60 | | - | else if ((q == "dislike")) |
---|
| 57 | + | else if ((n == "dislike")) |
---|
61 | 58 | | then -1 |
---|
62 | | - | else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + q)) |
---|
| 59 | + | else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + n)) |
---|
63 | 60 | | |
---|
64 | 61 | | |
---|
65 | | - | @Callable(r) |
---|
| 62 | + | @Callable(o) |
---|
66 | 63 | | func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0)) |
---|
67 | 64 | | then throw("This user already exists") |
---|
68 | 65 | | else { |
---|
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)]) |
---|
| 66 | + | let p = l() |
---|
| 67 | + | let q = ((p + ";") + g) |
---|
| 68 | + | let r = h("dao_members_size") |
---|
| 69 | + | let s = (r + 1) |
---|
| 70 | + | WriteSet([DataEntry((("dao_member_" + g) + "_status"), "propose"), DataEntry("dao_members", q), DataEntry("dao_members_size", s)]) |
---|
74 | 71 | | } |
---|
75 | 72 | | |
---|
76 | 73 | | |
---|
77 | 74 | | |
---|
78 | | - | @Callable(r) |
---|
79 | | - | func mRejectDAOMember (g) = if (!(f(r.caller))) |
---|
| 75 | + | @Callable(o) |
---|
| 76 | + | func mRejectDAOMember (g) = if (!(f(o.caller))) |
---|
80 | 77 | | then throw("access only to the DAO Manager") |
---|
81 | 78 | | else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")]) |
---|
82 | 79 | | |
---|
83 | 80 | | |
---|
84 | 81 | | |
---|
85 | | - | @Callable(r) |
---|
86 | | - | func mAddDAOMember (g) = if (!(f(r.caller))) |
---|
| 82 | + | @Callable(o) |
---|
| 83 | + | func mAddDAOMember (g) = if (!(f(o.caller))) |
---|
87 | 84 | | then throw("access only to the DAO Manager") |
---|
88 | 85 | | else { |
---|
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)]) |
---|
| 86 | + | let p = l() |
---|
| 87 | + | let q = ((p + ";") + g) |
---|
| 88 | + | let r = h("dao_members_size") |
---|
| 89 | + | let s = (r + 1) |
---|
| 90 | + | WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", q), DataEntry("dao_members_size", s)]) |
---|
94 | 91 | | } |
---|
95 | 92 | | |
---|
96 | 93 | | |
---|
97 | 94 | | |
---|
98 | | - | @Callable(r) |
---|
99 | | - | func mAddWorkingGroup (g) = if (!(f(r.caller))) |
---|
| 95 | + | @Callable(o) |
---|
| 96 | + | func mAddWorkingGroup (g) = if (!(f(o.caller))) |
---|
100 | 97 | | then throw("access only to the DAO Manager") |
---|
101 | 98 | | else { |
---|
102 | | - | let s = { |
---|
| 99 | + | let p = { |
---|
103 | 100 | | let d = getString(this, "dao_wg_members") |
---|
104 | 101 | | if ($isInstanceOf(d, "String")) |
---|
105 | 102 | | then { |
---|
106 | 103 | | let e = d |
---|
107 | 104 | | e |
---|
108 | 105 | | } |
---|
109 | 106 | | else "" |
---|
110 | 107 | | } |
---|
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)]) |
---|
| 108 | + | let q = ((p + ";") + g) |
---|
| 109 | + | let r = h("dao_wg_size") |
---|
| 110 | + | let s = (r + 1) |
---|
| 111 | + | WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", q), DataEntry("dao_wg_size", s)]) |
---|
115 | 112 | | } |
---|
116 | 113 | | |
---|
117 | 114 | | |
---|
118 | 115 | | |
---|
119 | | - | @Callable(r) |
---|
120 | | - | func mAddMembershipWorkingGroup (g) = if (!(f(r.caller))) |
---|
| 116 | + | @Callable(o) |
---|
| 117 | + | func mAddMembershipWorkingGroup (g) = if (!(f(o.caller))) |
---|
121 | 118 | | then throw("access only to the DAO Manager") |
---|
122 | 119 | | else { |
---|
123 | | - | let s = { |
---|
| 120 | + | let p = { |
---|
124 | 121 | | let d = getString(this, "dao_mwg_members") |
---|
125 | 122 | | if ($isInstanceOf(d, "String")) |
---|
126 | 123 | | then { |
---|
127 | 124 | | let e = d |
---|
128 | 125 | | e |
---|
129 | 126 | | } |
---|
130 | 127 | | else "" |
---|
131 | 128 | | } |
---|
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)]) |
---|
| 129 | + | let q = ((p + ";") + g) |
---|
| 130 | + | let r = h("dao_mwg_size") |
---|
| 131 | + | let s = (r + 1) |
---|
| 132 | + | WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", q), DataEntry("dao_mwg_size", s)]) |
---|
136 | 133 | | } |
---|
137 | 134 | | |
---|
138 | 135 | | |
---|
139 | 136 | | |
---|
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") |
---|
| 137 | + | @Callable(o) |
---|
| 138 | + | func wmgMembershipVoteForDAOMember (t,u) = { |
---|
| 139 | + | let v = toString(o.caller) |
---|
| 140 | + | let w = toString(o.caller) |
---|
| 141 | + | let x = m(u) |
---|
| 142 | + | let y = (("dao_member_" + t) + "_vote") |
---|
| 143 | + | let z = (("dao_member_" + t) + "_voted") |
---|
| 144 | + | let A = ((("dao_member_" + t) + "_votes_") + v) |
---|
147 | 145 | | let B = { |
---|
148 | | - | let d = getString(this, A) |
---|
| 146 | + | let d = getString(this, z) |
---|
149 | 147 | | if ($isInstanceOf(d, "String")) |
---|
150 | 148 | | then { |
---|
151 | 149 | | let e = d |
---|
152 | 150 | | e |
---|
153 | 151 | | } |
---|
154 | 152 | | else "" |
---|
155 | 153 | | } |
---|
156 | | - | let C = ((x + ";") + B) |
---|
157 | | - | let D = h(z) |
---|
158 | | - | let E = (D + y) |
---|
159 | | - | let F = a((("dao_mwg_member_" + x) + "_status")) |
---|
| 154 | + | let C = ((v + ";") + B) |
---|
| 155 | + | let D = h(y) |
---|
| 156 | + | let E = (D + x) |
---|
| 157 | + | let F = a((("dao_mwg_member_" + v) + "_status")) |
---|
160 | 158 | | if ((F == "approved")) |
---|
161 | | - | then if (l(m, n)) |
---|
162 | | - | then throw(("You have already voted. Caller " + x)) |
---|
163 | | - | else WriteSet([DataEntry(((m + "_voted_") + n), 1), DataEntry(z, E), DataEntry(A, C)]) |
---|
164 | | - | else throw(("You have no rights. Caller " + x)) |
---|
| 159 | + | then if ((h(((("dao_member_" + t) + "_votes_") + v)) > 0)) |
---|
| 160 | + | then throw(("You have already voted. Caller " + v)) |
---|
| 161 | + | else WriteSet([DataEntry(y, E), DataEntry(z, C), DataEntry(A, x)]) |
---|
| 162 | + | else throw(("You have no rights. Caller " + v)) |
---|
165 | 163 | | } |
---|
166 | 164 | | |
---|
167 | 165 | | |
---|