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:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAIAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADmlzV29ya2luZ0dyb3VwAAAAAQAAAAFhCQAAAAAAAAIJAQAA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W50ZWdlcgAAAAEFAAAACXZvdGluZ0tleQQAAAAObmV3Vm90aW5nU3RhdGUJAABkAAAAAgUAAAALdm90aW5nU3RhdGUFAAAADHZvdGVWYWx1ZUludAQAAAAMbXdnU3RhdHVzVmFsCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACCQABLAAAAAICAAAAD2Rhb19td2dfbWVtYmVyXwUAAAAGY2FsbGVyAgAAAAdfc3RhdHVzAwkAAAAAAAACBQAAAAxtd2dTdGF0dXNWYWwCAAAACGFwcHJvdmVkAwkBAAAAHWlzTWVtYmVyc2hpcFZvdGVkRm9yQ2FuZGlkYXRlAAAAAgUAAAARbWVtYmVyc2hpcEFkZHJlc3MFAAAAEGNhbmRpZGF0ZUFkZHJlc3MJAAACAAAAAQkAASwAAAACAgAAAB9Zb3UgaGF2ZSBhbHJlYWR5IHZvdGVkLiBDYWxsZXIgBQAAAAZjYWxsZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAABFtZW1iZXJzaGlwQWRkcmVzcwIAAAAHX3ZvdGVkXwUAAAAQY2FuZGlkYXRlQWRkcmVzcwAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAJdm90aW5nS2V5BQAAAA5uZXdWb3RpbmdTdGF0ZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIdm90ZWRLZXkFAAAACHZvdGVkVmFsBQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAABtZb3UgaGF2ZSBubyByaWdodHMuIENhbGxlciAFAAAABmNhbGxlcgAAAAAVxt/T",
"height": 1533789,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: AKvtQWdNoihHmJfZxPyqaRkW2HsJ4yUccREPgNE4PP9m
Next: Qi6YjdcN5N9KcyLFrL2wXvGrTmR5wczeWNH2e1BhcT7
Diff:
Old | New | | Differences |
---|
32 | 32 | | } |
---|
33 | 33 | | |
---|
34 | 34 | | |
---|
35 | | - | func i (j) = (a((("membership_" + toString(j)) + "_status")) == "approved") |
---|
| 35 | + | func i (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved") |
---|
36 | 36 | | |
---|
37 | 37 | | |
---|
38 | | - | func k (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved") |
---|
| 38 | + | func k (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved") |
---|
39 | 39 | | |
---|
40 | 40 | | |
---|
41 | | - | func l (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved") |
---|
| 41 | + | func l (m,n) = (h(((m + "_voted_") + n)) > 0) |
---|
42 | 42 | | |
---|
43 | 43 | | |
---|
44 | | - | func m (n,o) = (h(((n + "_voted_") + o)) > 0) |
---|
45 | | - | |
---|
46 | | - | |
---|
47 | | - | func p () = { |
---|
| 44 | + | func o () = { |
---|
48 | 45 | | let c = { |
---|
49 | 46 | | let d = getString(this, "dao_members") |
---|
50 | 47 | | if ($isInstanceOf(d, "String")) |
---|
|
58 | 55 | | } |
---|
59 | 56 | | |
---|
60 | 57 | | |
---|
61 | | - | func q (r) = if ((r == "like")) |
---|
| 58 | + | func p (q) = if ((q == "like")) |
---|
62 | 59 | | then 1 |
---|
63 | | - | else if ((r == "dislike")) |
---|
| 60 | + | else if ((q == "dislike")) |
---|
64 | 61 | | 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)) |
---|
66 | 63 | | |
---|
67 | 64 | | |
---|
68 | | - | @Callable(s) |
---|
| 65 | + | @Callable(r) |
---|
69 | 66 | | func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0)) |
---|
70 | 67 | | then throw("This user already exists") |
---|
71 | 68 | | 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)]) |
---|
77 | 74 | | } |
---|
78 | 75 | | |
---|
79 | 76 | | |
---|
80 | 77 | | |
---|
81 | | - | @Callable(s) |
---|
82 | | - | func mRejectDAOMember (g) = if (!(f(s.caller))) |
---|
| 78 | + | @Callable(r) |
---|
| 79 | + | func mRejectDAOMember (g) = if (!(f(r.caller))) |
---|
83 | 80 | | then throw("access only to the DAO Manager") |
---|
84 | 81 | | else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")]) |
---|
85 | 82 | | |
---|
86 | 83 | | |
---|
87 | 84 | | |
---|
88 | | - | @Callable(s) |
---|
89 | | - | func mAddDAOMember (g) = if (!(f(s.caller))) |
---|
| 85 | + | @Callable(r) |
---|
| 86 | + | func mAddDAOMember (g) = if (!(f(r.caller))) |
---|
90 | 87 | | then throw("access only to the DAO Manager") |
---|
91 | 88 | | 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)]) |
---|
97 | 94 | | } |
---|
98 | 95 | | |
---|
99 | 96 | | |
---|
100 | 97 | | |
---|
101 | | - | @Callable(s) |
---|
102 | | - | func mAddWorkingGroup (g) = if (!(f(s.caller))) |
---|
| 98 | + | @Callable(r) |
---|
| 99 | + | func mAddWorkingGroup (g) = if (!(f(r.caller))) |
---|
103 | 100 | | then throw("access only to the DAO Manager") |
---|
104 | 101 | | else { |
---|
105 | | - | let t = { |
---|
| 102 | + | let s = { |
---|
106 | 103 | | let d = getString(this, "dao_wg_members") |
---|
107 | 104 | | if ($isInstanceOf(d, "String")) |
---|
108 | 105 | | then { |
---|
|
111 | 108 | | } |
---|
112 | 109 | | else "" |
---|
113 | 110 | | } |
---|
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)]) |
---|
118 | 115 | | } |
---|
119 | 116 | | |
---|
120 | 117 | | |
---|
121 | 118 | | |
---|
122 | | - | @Callable(s) |
---|
123 | | - | func mAddMembershipWorkingGroup (g) = if (!(f(s.caller))) |
---|
| 119 | + | @Callable(r) |
---|
| 120 | + | func mAddMembershipWorkingGroup (g) = if (!(f(r.caller))) |
---|
124 | 121 | | then throw("access only to the DAO Manager") |
---|
125 | 122 | | else { |
---|
126 | | - | let t = { |
---|
| 123 | + | let s = { |
---|
127 | 124 | | let d = getString(this, "dao_mwg_members") |
---|
128 | 125 | | if ($isInstanceOf(d, "String")) |
---|
129 | 126 | | then { |
---|
|
132 | 129 | | } |
---|
133 | 130 | | else "" |
---|
134 | 131 | | } |
---|
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)]) |
---|
139 | 136 | | } |
---|
140 | 137 | | |
---|
141 | 138 | | |
---|
142 | 139 | | |
---|
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") |
---|
149 | 147 | | let B = { |
---|
150 | 148 | | let d = getString(this, A) |
---|
151 | 149 | | if ($isInstanceOf(d, "String")) |
---|
|
157 | 155 | | } |
---|
158 | 156 | | let C = h(z) |
---|
159 | 157 | | 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)) |
---|
165 | 164 | | } |
---|
166 | 165 | | |
---|
167 | 166 | | |
---|
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 | | - | func i (j) = (a((("membership_" + toString(j)) + "_status")) == "approved") |
---|
| 35 | + | func i (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved") |
---|
36 | 36 | | |
---|
37 | 37 | | |
---|
38 | | - | func k (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved") |
---|
| 38 | + | func k (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved") |
---|
39 | 39 | | |
---|
40 | 40 | | |
---|
41 | | - | func l (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved") |
---|
| 41 | + | func l (m,n) = (h(((m + "_voted_") + n)) > 0) |
---|
42 | 42 | | |
---|
43 | 43 | | |
---|
44 | | - | func m (n,o) = (h(((n + "_voted_") + o)) > 0) |
---|
45 | | - | |
---|
46 | | - | |
---|
47 | | - | func p () = { |
---|
| 44 | + | func o () = { |
---|
48 | 45 | | let c = { |
---|
49 | 46 | | let d = getString(this, "dao_members") |
---|
50 | 47 | | if ($isInstanceOf(d, "String")) |
---|
51 | 48 | | then { |
---|
52 | 49 | | let e = d |
---|
53 | 50 | | e |
---|
54 | 51 | | } |
---|
55 | 52 | | else "" |
---|
56 | 53 | | } |
---|
57 | 54 | | c |
---|
58 | 55 | | } |
---|
59 | 56 | | |
---|
60 | 57 | | |
---|
61 | | - | func q (r) = if ((r == "like")) |
---|
| 58 | + | func p (q) = if ((q == "like")) |
---|
62 | 59 | | then 1 |
---|
63 | | - | else if ((r == "dislike")) |
---|
| 60 | + | else if ((q == "dislike")) |
---|
64 | 61 | | 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)) |
---|
66 | 63 | | |
---|
67 | 64 | | |
---|
68 | | - | @Callable(s) |
---|
| 65 | + | @Callable(r) |
---|
69 | 66 | | func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0)) |
---|
70 | 67 | | then throw("This user already exists") |
---|
71 | 68 | | 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)]) |
---|
77 | 74 | | } |
---|
78 | 75 | | |
---|
79 | 76 | | |
---|
80 | 77 | | |
---|
81 | | - | @Callable(s) |
---|
82 | | - | func mRejectDAOMember (g) = if (!(f(s.caller))) |
---|
| 78 | + | @Callable(r) |
---|
| 79 | + | func mRejectDAOMember (g) = if (!(f(r.caller))) |
---|
83 | 80 | | then throw("access only to the DAO Manager") |
---|
84 | 81 | | else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")]) |
---|
85 | 82 | | |
---|
86 | 83 | | |
---|
87 | 84 | | |
---|
88 | | - | @Callable(s) |
---|
89 | | - | func mAddDAOMember (g) = if (!(f(s.caller))) |
---|
| 85 | + | @Callable(r) |
---|
| 86 | + | func mAddDAOMember (g) = if (!(f(r.caller))) |
---|
90 | 87 | | then throw("access only to the DAO Manager") |
---|
91 | 88 | | 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)]) |
---|
97 | 94 | | } |
---|
98 | 95 | | |
---|
99 | 96 | | |
---|
100 | 97 | | |
---|
101 | | - | @Callable(s) |
---|
102 | | - | func mAddWorkingGroup (g) = if (!(f(s.caller))) |
---|
| 98 | + | @Callable(r) |
---|
| 99 | + | func mAddWorkingGroup (g) = if (!(f(r.caller))) |
---|
103 | 100 | | then throw("access only to the DAO Manager") |
---|
104 | 101 | | else { |
---|
105 | | - | let t = { |
---|
| 102 | + | let s = { |
---|
106 | 103 | | let d = getString(this, "dao_wg_members") |
---|
107 | 104 | | if ($isInstanceOf(d, "String")) |
---|
108 | 105 | | then { |
---|
109 | 106 | | let e = d |
---|
110 | 107 | | e |
---|
111 | 108 | | } |
---|
112 | 109 | | else "" |
---|
113 | 110 | | } |
---|
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)]) |
---|
118 | 115 | | } |
---|
119 | 116 | | |
---|
120 | 117 | | |
---|
121 | 118 | | |
---|
122 | | - | @Callable(s) |
---|
123 | | - | func mAddMembershipWorkingGroup (g) = if (!(f(s.caller))) |
---|
| 119 | + | @Callable(r) |
---|
| 120 | + | func mAddMembershipWorkingGroup (g) = if (!(f(r.caller))) |
---|
124 | 121 | | then throw("access only to the DAO Manager") |
---|
125 | 122 | | else { |
---|
126 | | - | let t = { |
---|
| 123 | + | let s = { |
---|
127 | 124 | | let d = getString(this, "dao_mwg_members") |
---|
128 | 125 | | if ($isInstanceOf(d, "String")) |
---|
129 | 126 | | then { |
---|
130 | 127 | | let e = d |
---|
131 | 128 | | e |
---|
132 | 129 | | } |
---|
133 | 130 | | else "" |
---|
134 | 131 | | } |
---|
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)]) |
---|
139 | 136 | | } |
---|
140 | 137 | | |
---|
141 | 138 | | |
---|
142 | 139 | | |
---|
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") |
---|
149 | 147 | | let B = { |
---|
150 | 148 | | let d = getString(this, A) |
---|
151 | 149 | | if ($isInstanceOf(d, "String")) |
---|
152 | 150 | | then { |
---|
153 | 151 | | let e = d |
---|
154 | 152 | | e |
---|
155 | 153 | | } |
---|
156 | 154 | | else "" |
---|
157 | 155 | | } |
---|
158 | 156 | | let C = h(z) |
---|
159 | 157 | | 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)) |
---|
165 | 164 | | } |
---|
166 | 165 | | |
---|
167 | 166 | | |
---|