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:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAHAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADmlzV29ya2luZ0dyb3VwAAAAAQAAAAFhCQAAAAAAAAIJAQAA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GVyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAl2b3RpbmdLZXkFAAAADm5ld1ZvdGluZ1N0YXRlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAh2b3RlZEtleQUAAAALbmV3Vm90ZWRWYWwJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACHZvdGVzS2V5BQAAAAx2b3RlVmFsdWVJbnQFAAAAA25pbAkAAAIAAAABCQABLAAAAAICAAAAG1lvdSBoYXZlIG5vIHJpZ2h0cy4gQ2FsbGVyIAUAAAAGY2FsbGVyAAAAAAY/V+Q=", "height": 1534011, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3Vczk9k5BYTDuyMTMvwkxEu2p5BXdTavJ1FoUaKU2VHk Next: GxsMfURcFG7DZ71zwitNWCsD7VcJVVKr7UsfxkfziJx3 Diff:
OldNewDifferences
6464 then throw("This user already exists")
6565 else {
6666 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+ }
7175 }
7276
7377
8488 then throw("access only to the DAO Manager")
8589 else {
8690 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+ }
9199 }
92100
93101
105113 }
106114 else ""
107115 }
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+ }
112124 }
113125
114126
126138 }
127139 else ""
128140 }
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+ }
133149 }
134150
135151
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
3535 func i (j) = (a((("working_group_" + toString(j)) + "_status")) == "approved")
3636
3737
3838 func k (j) = (a((("dao_member_" + toString(j)) + "_status")) == "approved")
3939
4040
4141 func l () = {
4242 let c = {
4343 let d = getString(this, "dao_members")
4444 if ($isInstanceOf(d, "String"))
4545 then {
4646 let e = d
4747 e
4848 }
4949 else ""
5050 }
5151 c
5252 }
5353
5454
5555 func m (n) = if ((n == "like"))
5656 then 1
5757 else if ((n == "dislike"))
5858 then -1
5959 else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + n))
6060
6161
6262 @Callable(o)
6363 func aProposeCandidateForDAOMember (g) = if ((h((("member_" + g) + "_voting_state")) != 0))
6464 then throw("This user already exists")
6565 else {
6666 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+ }
7175 }
7276
7377
7478
7579 @Callable(o)
7680 func mRejectDAOMember (g) = if (!(f(o.caller)))
7781 then throw("access only to the DAO Manager")
7882 else WriteSet([DataEntry((("dao_member_" + g) + "_status"), "rejected")])
7983
8084
8185
8286 @Callable(o)
8387 func mAddDAOMember (g) = if (!(f(o.caller)))
8488 then throw("access only to the DAO Manager")
8589 else {
8690 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+ }
9199 }
92100
93101
94102
95103 @Callable(o)
96104 func mAddWorkingGroup (g) = if (!(f(o.caller)))
97105 then throw("access only to the DAO Manager")
98106 else {
99107 let p = {
100108 let d = getString(this, "dao_wg_members")
101109 if ($isInstanceOf(d, "String"))
102110 then {
103111 let e = d
104112 e
105113 }
106114 else ""
107115 }
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+ }
112124 }
113125
114126
115127
116128 @Callable(o)
117129 func mAddMembershipWorkingGroup (g) = if (!(f(o.caller)))
118130 then throw("access only to the DAO Manager")
119131 else {
120132 let p = {
121133 let d = getString(this, "dao_mwg_members")
122134 if ($isInstanceOf(d, "String"))
123135 then {
124136 let e = d
125137 e
126138 }
127139 else ""
128140 }
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+ }
133149 }
134150
135151
136152
137153 @Callable(o)
138154 func wmgMembershipVoteForDAOMember (t,u) = {
139155 let v = toString(o.caller)
140156 let w = toString(o.caller)
141157 let x = m(u)
142158 let y = (("dao_member_" + t) + "_vote")
143159 let z = (("dao_member_" + t) + "_voted")
144160 let A = ((("dao_member_" + t) + "_votes_") + v)
145161 let B = {
146162 let d = getString(this, z)
147163 if ($isInstanceOf(d, "String"))
148164 then {
149165 let e = d
150166 e
151167 }
152168 else ""
153169 }
154170 let C = ((v + ";") + B)
155171 let D = h(y)
156172 let E = (D + x)
157173 let F = a((("dao_mwg_member_" + v) + "_status"))
158174 if ((F == "approved"))
159175 then if ((h(((("dao_member_" + t) + "_votes_") + v)) > 0))
160176 then throw(("You have already voted. Caller " + v))
161177 else WriteSet([DataEntry(y, E), DataEntry(z, C), DataEntry(A, x)])
162178 else throw(("You have no rights. Caller " + v))
163179 }
164180
165181

github/deemru/w8io/169f3d6 
34.78 ms