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:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAIAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADmlzV29ya2luZ0dyb3VwAAAAAQAAAAFhCQAAAAAAAAIJAQAAAAx0cnlHZ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AAAAEFAAAACXZvdGluZ0tleQQAAAAObmV3Vm90aW5nU3RhdGUJAABkAAAAAgUAAAALdm90aW5nU3RhdGUFAAAADHZvdGVWYWx1ZUludAQAAAAMbXdnU3RhdHVzVmFsCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACCQABLAAAAAICAAAAD2Rhb19td2dfbWVtYmVyXwUAAAAGY2FsbGVyAgAAAAdfc3RhdHVzAwkAAAAAAAACBQAAAAxtd2dTdGF0dXNWYWwCAAAACGFwcHJvdmVkAwkBAAAAHWlzTWVtYmVyc2hpcFZvdGVkRm9yQ2FuZGlkYXRlAAAAAgUAAAARbWVtYmVyc2hpcEFkZHJlc3MFAAAAEGNhbmRpZGF0ZUFkZHJlc3MJAAACAAAAAQkAASwAAAACAgAAAB9Zb3UgaGF2ZSBhbHJlYWR5IHZvdGVkLiBDYWxsZXIgBQAAAAZjYWxsZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAABFtZW1iZXJzaGlwQWRkcmVzcwIAAAAHX3ZvdGVkXwUAAAAQY2FuZGlkYXRlQWRkcmVzcwAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAJdm90aW5nS2V5BQAAAA5uZXdWb3RpbmdTdGF0ZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIdm90ZWRLZXkFAAAACHZvdGVkVmFsBQAAAANuaWwJAAACAAAAAQkAASwAAAACAgAAABtZb3UgaGF2ZSBubyByaWdodHMuIENhbGxlciAFAAAABmNhbGxlcgAAAAAVxt/T", "height": 1533789, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AKvtQWdNoihHmJfZxPyqaRkW2HsJ4yUccREPgNE4PP9m Next: Qi6YjdcN5N9KcyLFrL2wXvGrTmR5wczeWNH2e1BhcT7 Diff:
OldNewDifferences
2424 }
2525 val
2626 }
27-
28-
29-func isMembershipWorkingGroup (a) = (tryGetString((("membership_" + toString(a)) + "_status")) == "approved")
3027
3128
3229 func isWorkingGroup (a) = (tryGetString((("working_group_" + toString(a)) + "_status")) == "approved")
127124
128125 @Callable(i)
129126 func wmgMembershipVoteForDAOMember (candidateAddress,voteValue) = {
127+ let caller = toString(i.caller)
130128 let membershipAddress = toString(i.caller)
131129 let voteValueInt = getVoteValue(voteValue)
132130 let votingKey = (("dao_member_" + candidateAddress) + "_vote")
139137 }
140138 let votingState = tryGetInteger(votingKey)
141139 let newVotingState = (votingState + voteValueInt)
142- if (isMembershipWorkingGroup(i.caller))
140+ let mwgStatusVal = tryGetString((("dao_mwg_member_" + caller) + "_status"))
141+ if ((mwgStatusVal == "approved"))
143142 then if (isMembershipVotedForCandidate(membershipAddress, candidateAddress))
144- then throw("You have already voted")
143+ then throw(("You have already voted. Caller " + caller))
145144 else WriteSet([DataEntry(((membershipAddress + "_voted_") + candidateAddress), 1), DataEntry(votingKey, newVotingState), DataEntry(votedKey, votedVal)])
146- else throw("You have no rights")
145+ else throw(("You have no rights. Caller " + caller))
147146 }
148147
149148
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func tryGetString (key) = {
55 let val = match getString(this, key) {
66 case b: String =>
77 b
88 case _ =>
99 ""
1010 }
1111 val
1212 }
1313
1414
1515 func isManager (address) = (address == this)
1616
1717
1818 func tryGetInteger (key) = {
1919 let val = match getInteger(this, key) {
2020 case b: Int =>
2121 b
2222 case _ =>
2323 0
2424 }
2525 val
2626 }
27-
28-
29-func isMembershipWorkingGroup (a) = (tryGetString((("membership_" + toString(a)) + "_status")) == "approved")
3027
3128
3229 func isWorkingGroup (a) = (tryGetString((("working_group_" + toString(a)) + "_status")) == "approved")
3330
3431
3532 func isDAOMember (a) = (tryGetString((("dao_member_" + toString(a)) + "_status")) == "approved")
3633
3734
3835 func isMembershipVotedForCandidate (membershipAddress,candidateAddress) = (tryGetInteger(((membershipAddress + "_voted_") + candidateAddress)) > 0)
3936
4037
4138 func getDAOMember () = {
4239 let val = match getString(this, "dao_members") {
4340 case b: String =>
4441 b
4542 case _ =>
4643 ""
4744 }
4845 val
4946 }
5047
5148
5249 func getVoteValue (s) = if ((s == "like"))
5350 then 1
5451 else if ((s == "dislike"))
5552 then -1
5653 else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + s))
5754
5855
5956 @Callable(i)
6057 func aProposeCandidateForDAOMember (address) = if ((tryGetInteger((("member_" + address) + "_voting_state")) != 0))
6158 then throw("This user already exists")
6259 else {
6360 let group = getDAOMember()
6461 let newGroup = ((group + ";") + address)
6562 let groupSize = tryGetInteger("dao_members_size")
6663 let newGroupSize = (groupSize + 1)
6764 WriteSet([DataEntry((("dao_member_" + address) + "_status"), "propose"), DataEntry("dao_members", newGroup), DataEntry("dao_members_size", newGroupSize)])
6865 }
6966
7067
7168
7269 @Callable(i)
7370 func mRejectDAOMember (address) = if (!(isManager(i.caller)))
7471 then throw("access only to the DAO Manager")
7572 else WriteSet([DataEntry((("dao_member_" + address) + "_status"), "rejected")])
7673
7774
7875
7976 @Callable(i)
8077 func mAddDAOMember (address) = if (!(isManager(i.caller)))
8178 then throw("access only to the DAO Manager")
8279 else {
8380 let group = getDAOMember()
8481 let newGroup = ((group + ";") + address)
8582 let groupSize = tryGetInteger("dao_members_size")
8683 let newGroupSize = (groupSize + 1)
8784 WriteSet([DataEntry((("dao_member_" + address) + "_status"), "approved"), DataEntry("dao_members", newGroup), DataEntry("dao_members_size", newGroupSize)])
8885 }
8986
9087
9188
9289 @Callable(i)
9390 func mAddWorkingGroup (address) = if (!(isManager(i.caller)))
9491 then throw("access only to the DAO Manager")
9592 else {
9693 let group = match getString(this, "dao_wg_members") {
9794 case b: String =>
9895 b
9996 case _ =>
10097 ""
10198 }
10299 let newGroup = ((group + ";") + address)
103100 let groupSize = tryGetInteger("dao_wg_size")
104101 let newGroupSize = (groupSize + 1)
105102 WriteSet([DataEntry((("dao_wg_member_" + address) + "_status"), "approved"), DataEntry("dao_wg_members", newGroup), DataEntry("dao_wg_size", newGroupSize)])
106103 }
107104
108105
109106
110107 @Callable(i)
111108 func mAddMembershipWorkingGroup (address) = if (!(isManager(i.caller)))
112109 then throw("access only to the DAO Manager")
113110 else {
114111 let group = match getString(this, "dao_mwg_members") {
115112 case b: String =>
116113 b
117114 case _ =>
118115 ""
119116 }
120117 let newGroup = ((group + ";") + address)
121118 let groupSize = tryGetInteger("dao_mwg_size")
122119 let newGroupSize = (groupSize + 1)
123120 WriteSet([DataEntry((("dao_mwg_member_" + address) + "_status"), "approved"), DataEntry("dao_mwg_members", newGroup), DataEntry("dao_mwg_size", newGroupSize)])
124121 }
125122
126123
127124
128125 @Callable(i)
129126 func wmgMembershipVoteForDAOMember (candidateAddress,voteValue) = {
127+ let caller = toString(i.caller)
130128 let membershipAddress = toString(i.caller)
131129 let voteValueInt = getVoteValue(voteValue)
132130 let votingKey = (("dao_member_" + candidateAddress) + "_vote")
133131 let votedKey = (("dao_member_" + candidateAddress) + "_voted")
134132 let votedVal = match getString(this, votedKey) {
135133 case b: String =>
136134 b
137135 case _ =>
138136 ""
139137 }
140138 let votingState = tryGetInteger(votingKey)
141139 let newVotingState = (votingState + voteValueInt)
142- if (isMembershipWorkingGroup(i.caller))
140+ let mwgStatusVal = tryGetString((("dao_mwg_member_" + caller) + "_status"))
141+ if ((mwgStatusVal == "approved"))
143142 then if (isMembershipVotedForCandidate(membershipAddress, candidateAddress))
144- then throw("You have already voted")
143+ then throw(("You have already voted. Caller " + caller))
145144 else WriteSet([DataEntry(((membershipAddress + "_voted_") + candidateAddress), 1), DataEntry(votingKey, newVotingState), DataEntry(votedKey, votedVal)])
146- else throw("You have no rights")
145+ else throw(("You have no rights. Caller " + caller))
147146 }
148147
149148

github/deemru/w8io/026f985 
93.73 ms