tx · 45wYiWKPL6oEZ4bkbGpGGM5VuAwxqJPAJ9nJeNqCQK2Y 3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT: -0.01700000 Waves 2021.05.20 15:38 [1534011] smart account 3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT > SELF 0.00000000 Waves
{ "type": 13, "id": "45wYiWKPL6oEZ4bkbGpGGM5VuAwxqJPAJ9nJeNqCQK2Y", "fee": 1700000, "feeAssetId": null, "timestamp": 1621514290320, "version": 2, "chainId": 84, "sender": "3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT", "senderPublicKey": "5CSJYiEQvEGm3vH52UCQRkmhw7TV5ZzRhWptXi2hjM7T", "proofs": [ "4Cmn2HV4iCiM5uC86x7sjouA5tJd2uNTGjBm6TUGxQpQEhLZbxrUYXSbo8E2LWJNSYdeQSaHJHtkZEuKezAtBVLh" ], "script": "base64:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAHAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADmlzV29ya2luZ0dyb3VwAAAAAQAAAAFhCQAAAAAAAAIJAQAAA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VyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAl2b3RpbmdLZXkFAAAADm5ld1ZvdGluZ1N0YXRlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAh2b3RlZEtleQUAAAALbmV3Vm90ZWRWYWwJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACHZvdGVzS2V5BQAAAAx2b3RlVmFsdWVJbnQFAAAAA25pbAkAAAIAAAABCQABLAAAAAICAAAAG1lvdSBoYXZlIG5vIHJpZ2h0cy4gQ2FsbGVyIAUAAAAGY2FsbGVyAAAAAAY/V+Q=", "height": 1534011, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3Vczk9k5BYTDuyMTMvwkxEu2p5BXdTavJ1FoUaKU2VHk Next: GxsMfURcFG7DZ71zwitNWCsD7VcJVVKr7UsfxkfziJx3 Diff:
Old | New | Differences | |
---|---|---|---|
64 | 64 | then throw("This user already exists") | |
65 | 65 | else { | |
66 | 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)]) | |
67 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
68 | + | then throw("This user is already in the group") | |
69 | + | else { | |
70 | + | let q = ((p + ";") + g) | |
71 | + | let r = h("dao_members_size") | |
72 | + | let s = (r + 1) | |
73 | + | WriteSet([DataEntry((("dao_member_" + g) + "_status"), "propose"), DataEntry("dao_members", q), DataEntry("dao_members_size", s)]) | |
74 | + | } | |
71 | 75 | } | |
72 | 76 | ||
73 | 77 | ||
84 | 88 | then throw("access only to the DAO Manager") | |
85 | 89 | else { | |
86 | 90 | 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)]) | |
91 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
92 | + | then throw("This user is already in the group") | |
93 | + | else { | |
94 | + | let q = ((p + ";") + g) | |
95 | + | let r = h("dao_members_size") | |
96 | + | let s = (r + 1) | |
97 | + | WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", q), DataEntry("dao_members_size", s)]) | |
98 | + | } | |
91 | 99 | } | |
92 | 100 | ||
93 | 101 | ||
105 | 113 | } | |
106 | 114 | else "" | |
107 | 115 | } | |
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)]) | |
116 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
117 | + | then throw("This user is already in the group") | |
118 | + | else { | |
119 | + | let q = ((p + ";") + g) | |
120 | + | let r = h("dao_wg_size") | |
121 | + | let s = (r + 1) | |
122 | + | WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", q), DataEntry("dao_wg_size", s)]) | |
123 | + | } | |
112 | 124 | } | |
113 | 125 | ||
114 | 126 | ||
126 | 138 | } | |
127 | 139 | else "" | |
128 | 140 | } | |
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)]) | |
141 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
142 | + | then throw("This user is already in the group") | |
143 | + | else { | |
144 | + | let q = ((p + ";") + g) | |
145 | + | let r = h("dao_mwg_size") | |
146 | + | let s = (r + 1) | |
147 | + | WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", q), DataEntry("dao_mwg_size", s)]) | |
148 | + | } | |
133 | 149 | } | |
134 | 150 | ||
135 | 151 |
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 | 41 | func l () = { | |
42 | 42 | let c = { | |
43 | 43 | let d = getString(this, "dao_members") | |
44 | 44 | if ($isInstanceOf(d, "String")) | |
45 | 45 | then { | |
46 | 46 | let e = d | |
47 | 47 | e | |
48 | 48 | } | |
49 | 49 | else "" | |
50 | 50 | } | |
51 | 51 | c | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func m (n) = if ((n == "like")) | |
56 | 56 | then 1 | |
57 | 57 | else if ((n == "dislike")) | |
58 | 58 | then -1 | |
59 | 59 | else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + n)) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(o) | |
63 | 63 | func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0)) | |
64 | 64 | then throw("This user already exists") | |
65 | 65 | else { | |
66 | 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)]) | |
67 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
68 | + | then throw("This user is already in the group") | |
69 | + | else { | |
70 | + | let q = ((p + ";") + g) | |
71 | + | let r = h("dao_members_size") | |
72 | + | let s = (r + 1) | |
73 | + | 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 | ||
75 | 79 | @Callable(o) | |
76 | 80 | func mRejectDAOMember (g) = if (!(f(o.caller))) | |
77 | 81 | then throw("access only to the DAO Manager") | |
78 | 82 | else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")]) | |
79 | 83 | ||
80 | 84 | ||
81 | 85 | ||
82 | 86 | @Callable(o) | |
83 | 87 | func mAddDAOMember (g) = if (!(f(o.caller))) | |
84 | 88 | then throw("access only to the DAO Manager") | |
85 | 89 | else { | |
86 | 90 | 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)]) | |
91 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
92 | + | then throw("This user is already in the group") | |
93 | + | else { | |
94 | + | let q = ((p + ";") + g) | |
95 | + | let r = h("dao_members_size") | |
96 | + | let s = (r + 1) | |
97 | + | WriteSet([DataEntry((("dao_member_" + g) + "_status"), "approved"), DataEntry("dao_members", q), DataEntry("dao_members_size", s)]) | |
98 | + | } | |
91 | 99 | } | |
92 | 100 | ||
93 | 101 | ||
94 | 102 | ||
95 | 103 | @Callable(o) | |
96 | 104 | func mAddWorkingGroup (g) = if (!(f(o.caller))) | |
97 | 105 | then throw("access only to the DAO Manager") | |
98 | 106 | else { | |
99 | 107 | let p = { | |
100 | 108 | let d = getString(this, "dao_wg_members") | |
101 | 109 | if ($isInstanceOf(d, "String")) | |
102 | 110 | then { | |
103 | 111 | let e = d | |
104 | 112 | e | |
105 | 113 | } | |
106 | 114 | else "" | |
107 | 115 | } | |
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)]) | |
116 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
117 | + | then throw("This user is already in the group") | |
118 | + | else { | |
119 | + | let q = ((p + ";") + g) | |
120 | + | let r = h("dao_wg_size") | |
121 | + | let s = (r + 1) | |
122 | + | WriteSet([DataEntry((("dao_wg_member_" + g) + "_status"), "approved"), DataEntry("dao_wg_members", q), DataEntry("dao_wg_size", s)]) | |
123 | + | } | |
112 | 124 | } | |
113 | 125 | ||
114 | 126 | ||
115 | 127 | ||
116 | 128 | @Callable(o) | |
117 | 129 | func mAddMembershipWorkingGroup (g) = if (!(f(o.caller))) | |
118 | 130 | then throw("access only to the DAO Manager") | |
119 | 131 | else { | |
120 | 132 | let p = { | |
121 | 133 | let d = getString(this, "dao_mwg_members") | |
122 | 134 | if ($isInstanceOf(d, "String")) | |
123 | 135 | then { | |
124 | 136 | let e = d | |
125 | 137 | e | |
126 | 138 | } | |
127 | 139 | else "" | |
128 | 140 | } | |
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)]) | |
141 | + | if ((lastIndexOf(p, g, 0) != 0)) | |
142 | + | then throw("This user is already in the group") | |
143 | + | else { | |
144 | + | let q = ((p + ";") + g) | |
145 | + | let r = h("dao_mwg_size") | |
146 | + | let s = (r + 1) | |
147 | + | WriteSet([DataEntry((("dao_mwg_member_" + g) + "_status"), "approved"), DataEntry("dao_mwg_members", q), DataEntry("dao_mwg_size", s)]) | |
148 | + | } | |
133 | 149 | } | |
134 | 150 | ||
135 | 151 | ||
136 | 152 | ||
137 | 153 | @Callable(o) | |
138 | 154 | func wmgMembershipVoteForDAOMember (t,u) = { | |
139 | 155 | let v = toString(o.caller) | |
140 | 156 | let w = toString(o.caller) | |
141 | 157 | let x = m(u) | |
142 | 158 | let y = (("dao_member_" + t) + "_vote") | |
143 | 159 | let z = (("dao_member_" + t) + "_voted") | |
144 | 160 | let A = ((("dao_member_" + t) + "_votes_") + v) | |
145 | 161 | let B = { | |
146 | 162 | let d = getString(this, z) | |
147 | 163 | if ($isInstanceOf(d, "String")) | |
148 | 164 | then { | |
149 | 165 | let e = d | |
150 | 166 | e | |
151 | 167 | } | |
152 | 168 | else "" | |
153 | 169 | } | |
154 | 170 | let C = ((v + ";") + B) | |
155 | 171 | let D = h(y) | |
156 | 172 | let E = (D + x) | |
157 | 173 | let F = a((("dao_mwg_member_" + v) + "_status")) | |
158 | 174 | if ((F == "approved")) | |
159 | 175 | then if ((h(((("dao_member_" + t) + "_votes_") + v)) > 0)) | |
160 | 176 | then throw(("You have already voted. Caller " + v)) | |
161 | 177 | else WriteSet([DataEntry(y, E), DataEntry(z, C), DataEntry(A, x)]) | |
162 | 178 | else throw(("You have no rights. Caller " + v)) | |
163 | 179 | } | |
164 | 180 | ||
165 | 181 |
github/deemru/w8io/169f3d6 34.78 ms ◑