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