tx · Qi6YjdcN5N9KcyLFrL2wXvGrTmR5wczeWNH2e1BhcT7

3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT:  -0.04000000 Waves

2021.05.20 12:58 [1533850] smart account 3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT > SELF 0.00000000 Waves

{ "type": 13, "id": "Qi6YjdcN5N9KcyLFrL2wXvGrTmR5wczeWNH2e1BhcT7", "fee": 4000000, "feeAssetId": null, "timestamp": 1621504754154, "version": 2, "chainId": 84, "sender": "3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT", "senderPublicKey": "5CSJYiEQvEGm3vH52UCQRkmhw7TV5ZzRhWptXi2hjM7T", "proofs": [ "2fWHTsiZNrzdUeTZ5u8hWnYQzcvjiQFVUpSDdv4UkgoWb5VquS7sEVLtaRj8bMMqYFtEdPoMKbHfy5Jm2DCtq64F" ], "script": "base64:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAIAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADmlzV29ya2luZ0dyb3VwAAAAAQAAAAFhCQAAAAAAAAIJAQAAAAx0c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BQ98wJSNYn5rmFg7Ld Next: 3Vczk9k5BYTDuyMTMvwkxEu2p5BXdTavJ1FoUaKU2VHk Diff:
OldNewDifferences
135135 case _ =>
136136 ""
137137 }
138+ let newVotedVal = ((caller + ";") + votedVal)
138139 let votingState = tryGetInteger(votingKey)
139140 let newVotingState = (votingState + voteValueInt)
140141 let mwgStatusVal = tryGetString((("dao_mwg_member_" + caller) + "_status"))
141142 if ((mwgStatusVal == "approved"))
142143 then if (isMembershipVotedForCandidate(membershipAddress, candidateAddress))
143144 then throw(("You have already voted. Caller " + caller))
144- else WriteSet([DataEntry(((membershipAddress + "_voted_") + candidateAddress), 1), DataEntry(votingKey, newVotingState), DataEntry(votedKey, votedVal)])
145+ else WriteSet([DataEntry(((membershipAddress + "_voted_") + candidateAddress), 1), DataEntry(votingKey, newVotingState), DataEntry(votedKey, newVotedVal)])
145146 else throw(("You have no rights. Caller " + caller))
146147 }
147148
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 }
2727
2828
2929 func isWorkingGroup (a) = (tryGetString((("working_group_" + toString(a)) + "_status")) == "approved")
3030
3131
3232 func isDAOMember (a) = (tryGetString((("dao_member_" + toString(a)) + "_status")) == "approved")
3333
3434
3535 func isMembershipVotedForCandidate (membershipAddress,candidateAddress) = (tryGetInteger(((membershipAddress + "_voted_") + candidateAddress)) > 0)
3636
3737
3838 func getDAOMember () = {
3939 let val = match getString(this, "dao_members") {
4040 case b: String =>
4141 b
4242 case _ =>
4343 ""
4444 }
4545 val
4646 }
4747
4848
4949 func getVoteValue (s) = if ((s == "like"))
5050 then 1
5151 else if ((s == "dislike"))
5252 then -1
5353 else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + s))
5454
5555
5656 @Callable(i)
5757 func aProposeCandidateForDAOMember (address) = if ((tryGetInteger((("member_" + address) + "_voting_state")) != 0))
5858 then throw("This user already exists")
5959 else {
6060 let group = getDAOMember()
6161 let newGroup = ((group + ";") + address)
6262 let groupSize = tryGetInteger("dao_members_size")
6363 let newGroupSize = (groupSize + 1)
6464 WriteSet([DataEntry((("dao_member_" + address) + "_status"), "propose"), DataEntry("dao_members", newGroup), DataEntry("dao_members_size", newGroupSize)])
6565 }
6666
6767
6868
6969 @Callable(i)
7070 func mRejectDAOMember (address) = if (!(isManager(i.caller)))
7171 then throw("access only to the DAO Manager")
7272 else WriteSet([DataEntry((("dao_member_" + address) + "_status"), "rejected")])
7373
7474
7575
7676 @Callable(i)
7777 func mAddDAOMember (address) = if (!(isManager(i.caller)))
7878 then throw("access only to the DAO Manager")
7979 else {
8080 let group = getDAOMember()
8181 let newGroup = ((group + ";") + address)
8282 let groupSize = tryGetInteger("dao_members_size")
8383 let newGroupSize = (groupSize + 1)
8484 WriteSet([DataEntry((("dao_member_" + address) + "_status"), "approved"), DataEntry("dao_members", newGroup), DataEntry("dao_members_size", newGroupSize)])
8585 }
8686
8787
8888
8989 @Callable(i)
9090 func mAddWorkingGroup (address) = if (!(isManager(i.caller)))
9191 then throw("access only to the DAO Manager")
9292 else {
9393 let group = match getString(this, "dao_wg_members") {
9494 case b: String =>
9595 b
9696 case _ =>
9797 ""
9898 }
9999 let newGroup = ((group + ";") + address)
100100 let groupSize = tryGetInteger("dao_wg_size")
101101 let newGroupSize = (groupSize + 1)
102102 WriteSet([DataEntry((("dao_wg_member_" + address) + "_status"), "approved"), DataEntry("dao_wg_members", newGroup), DataEntry("dao_wg_size", newGroupSize)])
103103 }
104104
105105
106106
107107 @Callable(i)
108108 func mAddMembershipWorkingGroup (address) = if (!(isManager(i.caller)))
109109 then throw("access only to the DAO Manager")
110110 else {
111111 let group = match getString(this, "dao_mwg_members") {
112112 case b: String =>
113113 b
114114 case _ =>
115115 ""
116116 }
117117 let newGroup = ((group + ";") + address)
118118 let groupSize = tryGetInteger("dao_mwg_size")
119119 let newGroupSize = (groupSize + 1)
120120 WriteSet([DataEntry((("dao_mwg_member_" + address) + "_status"), "approved"), DataEntry("dao_mwg_members", newGroup), DataEntry("dao_mwg_size", newGroupSize)])
121121 }
122122
123123
124124
125125 @Callable(i)
126126 func wmgMembershipVoteForDAOMember (candidateAddress,voteValue) = {
127127 let caller = toString(i.caller)
128128 let membershipAddress = toString(i.caller)
129129 let voteValueInt = getVoteValue(voteValue)
130130 let votingKey = (("dao_member_" + candidateAddress) + "_vote")
131131 let votedKey = (("dao_member_" + candidateAddress) + "_voted")
132132 let votedVal = match getString(this, votedKey) {
133133 case b: String =>
134134 b
135135 case _ =>
136136 ""
137137 }
138+ let newVotedVal = ((caller + ";") + votedVal)
138139 let votingState = tryGetInteger(votingKey)
139140 let newVotingState = (votingState + voteValueInt)
140141 let mwgStatusVal = tryGetString((("dao_mwg_member_" + caller) + "_status"))
141142 if ((mwgStatusVal == "approved"))
142143 then if (isMembershipVotedForCandidate(membershipAddress, candidateAddress))
143144 then throw(("You have already voted. Caller " + caller))
144- else WriteSet([DataEntry(((membershipAddress + "_voted_") + candidateAddress), 1), DataEntry(votingKey, newVotingState), DataEntry(votedKey, votedVal)])
145+ else WriteSet([DataEntry(((membershipAddress + "_voted_") + candidateAddress), 1), DataEntry(votingKey, newVotingState), DataEntry(votedKey, newVotedVal)])
145146 else throw(("You have no rights. Caller " + caller))
146147 }
147148
148149

github/deemru/w8io/026f985 
30.03 ms