tx · AKvtQWdNoihHmJfZxPyqaRkW2HsJ4yUccREPgNE4PP9m 3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT: -0.03000000 Waves 2021.05.20 11:47 [1533777] smart account 3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT > SELF 0.00000000 Waves
{ "type": 13, "id": "AKvtQWdNoihHmJfZxPyqaRkW2HsJ4yUccREPgNE4PP9m", "fee": 3000000, "feeAssetId": null, "timestamp": 1621500519653, "version": 2, "chainId": 84, "sender": "3MqZkBUDKbXPKEq2sMtxtSahzX5n8AVDTyT", "senderPublicKey": "5CSJYiEQvEGm3vH52UCQRkmhw7TV5ZzRhWptXi2hjM7T", "proofs": [ "qaYmHoeR4crgkR1nn3UGKQzDCyD82aqLS7qoYbXUuyFfHZpiFHw3h3K8MU7WYPMLu5ZVCESfeJb5UYGQnczuvbM" ], "script": "base64:AAIDAAAAAAAAACEIARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAJAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAJaXNNYW5hZ2VyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAAGGlzTWVtYmVyc2hpcFdvcmtpbmdHcm91cAAAAAEAAAABYQkAAAAAAAACCQEAA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AAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAABAAAAAt2b3RpbmdTdGF0ZQkBAAAADXRyeUdldEludGVnZXIAAAABBQAAAAl2b3RpbmdLZXkEAAAADm5ld1ZvdGluZ1N0YXRlCQAAZAAAAAIFAAAAC3ZvdGluZ1N0YXRlBQAAAAx2b3RlVmFsdWVJbnQDCQEAAAAYaXNNZW1iZXJzaGlwV29ya2luZ0dyb3VwAAAAAQgFAAAAAWkAAAAGY2FsbGVyAwkBAAAAHWlzTWVtYmVyc2hpcFZvdGVkRm9yQ2FuZGlkYXRlAAAAAgUAAAARbWVtYmVyc2hpcEFkZHJlc3MFAAAAEGNhbmRpZGF0ZUFkZHJlc3MJAAACAAAAAQIAAAAWWW91IGhhdmUgYWxyZWFkeSB2b3RlZAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAAEW1lbWJlcnNoaXBBZGRyZXNzAgAAAAdfdm90ZWRfBQAAABBjYW5kaWRhdGVBZGRyZXNzAAAAAAAAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAl2b3RpbmdLZXkFAAAADm5ld1ZvdGluZ1N0YXRlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAh2b3RlZEtleQUAAAAIdm90ZWRWYWwFAAAAA25pbAkAAAIAAAABAgAAABJZb3UgaGF2ZSBubyByaWdodHMAAAAAFHyhsg==", "height": 1533777, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2F57F9kM2cYbt8CaMkCAyV5X5atCV4agp3NJBJcJs9FH Next: DnpksS99tmhBCCDBaXXBU1ZJ4hBQ98wJSNYn5rmFg7Ld Diff:
Old | New | Differences | |
---|---|---|---|
120 | 120 | let newGroup = ((group + ";") + address) | |
121 | 121 | let groupSize = tryGetInteger("dao_mwg_size") | |
122 | 122 | let newGroupSize = (groupSize + 1) | |
123 | - | WriteSet([DataEntry((("dao_mwg | |
123 | + | WriteSet([DataEntry((("dao_mwg_member_" + address) + "_status"), "approved"), DataEntry("dao_mwg_members", newGroup), DataEntry("dao_mwg_size", newGroupSize)]) | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func tryGetString (key) = { | |
5 | 5 | let val = match getString(this, key) { | |
6 | 6 | case b: String => | |
7 | 7 | b | |
8 | 8 | case _ => | |
9 | 9 | "" | |
10 | 10 | } | |
11 | 11 | val | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func isManager (address) = (address == this) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func tryGetInteger (key) = { | |
19 | 19 | let val = match getInteger(this, key) { | |
20 | 20 | case b: Int => | |
21 | 21 | b | |
22 | 22 | case _ => | |
23 | 23 | 0 | |
24 | 24 | } | |
25 | 25 | val | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func isMembershipWorkingGroup (a) = (tryGetString((("membership_" + toString(a)) + "_status")) == "approved") | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func isWorkingGroup (a) = (tryGetString((("working_group_" + toString(a)) + "_status")) == "approved") | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func isDAOMember (a) = (tryGetString((("dao_member_" + toString(a)) + "_status")) == "approved") | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func isMembershipVotedForCandidate (membershipAddress,candidateAddress) = (tryGetInteger(((membershipAddress + "_voted_") + candidateAddress)) > 0) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getDAOMember () = { | |
42 | 42 | let val = match getString(this, "dao_members") { | |
43 | 43 | case b: String => | |
44 | 44 | b | |
45 | 45 | case _ => | |
46 | 46 | "" | |
47 | 47 | } | |
48 | 48 | val | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getVoteValue (s) = if ((s == "like")) | |
53 | 53 | then 1 | |
54 | 54 | else if ((s == "dislike")) | |
55 | 55 | then -1 | |
56 | 56 | else throw(("You need to vote with 'like' or 'dislike' value. You specified:" + s)) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | @Callable(i) | |
60 | 60 | func aProposeCandidateForDAOMember (address) = if ((tryGetInteger((("member_" + address) + "_voting_state")) != 0)) | |
61 | 61 | then throw("This user already exists") | |
62 | 62 | else { | |
63 | 63 | let group = getDAOMember() | |
64 | 64 | let newGroup = ((group + ";") + address) | |
65 | 65 | let groupSize = tryGetInteger("dao_members_size") | |
66 | 66 | let newGroupSize = (groupSize + 1) | |
67 | 67 | WriteSet([DataEntry((("dao_member_" + address) + "_status"), "propose"), DataEntry("dao_members", newGroup), DataEntry("dao_members_size", newGroupSize)]) | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | 73 | func mRejectDAOMember (address) = if (!(isManager(i.caller))) | |
74 | 74 | then throw("access only to the DAO Manager") | |
75 | 75 | else WriteSet([DataEntry((("dao_member_" + address) + "_status"), "rejected")]) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | ||
79 | 79 | @Callable(i) | |
80 | 80 | func mAddDAOMember (address) = if (!(isManager(i.caller))) | |
81 | 81 | then throw("access only to the DAO Manager") | |
82 | 82 | else { | |
83 | 83 | let group = getDAOMember() | |
84 | 84 | let newGroup = ((group + ";") + address) | |
85 | 85 | let groupSize = tryGetInteger("dao_members_size") | |
86 | 86 | let newGroupSize = (groupSize + 1) | |
87 | 87 | WriteSet([DataEntry((("dao_member_" + address) + "_status"), "approved"), DataEntry("dao_members", newGroup), DataEntry("dao_members_size", newGroupSize)]) | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
92 | 92 | @Callable(i) | |
93 | 93 | func mAddWorkingGroup (address) = if (!(isManager(i.caller))) | |
94 | 94 | then throw("access only to the DAO Manager") | |
95 | 95 | else { | |
96 | 96 | let group = match getString(this, "dao_wg_members") { | |
97 | 97 | case b: String => | |
98 | 98 | b | |
99 | 99 | case _ => | |
100 | 100 | "" | |
101 | 101 | } | |
102 | 102 | let newGroup = ((group + ";") + address) | |
103 | 103 | let groupSize = tryGetInteger("dao_wg_size") | |
104 | 104 | let newGroupSize = (groupSize + 1) | |
105 | 105 | WriteSet([DataEntry((("dao_wg_member_" + address) + "_status"), "approved"), DataEntry("dao_wg_members", newGroup), DataEntry("dao_wg_size", newGroupSize)]) | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(i) | |
111 | 111 | func mAddMembershipWorkingGroup (address) = if (!(isManager(i.caller))) | |
112 | 112 | then throw("access only to the DAO Manager") | |
113 | 113 | else { | |
114 | 114 | let group = match getString(this, "dao_mwg_members") { | |
115 | 115 | case b: String => | |
116 | 116 | b | |
117 | 117 | case _ => | |
118 | 118 | "" | |
119 | 119 | } | |
120 | 120 | let newGroup = ((group + ";") + address) | |
121 | 121 | let groupSize = tryGetInteger("dao_mwg_size") | |
122 | 122 | let newGroupSize = (groupSize + 1) | |
123 | - | WriteSet([DataEntry((("dao_mwg | |
123 | + | WriteSet([DataEntry((("dao_mwg_member_" + address) + "_status"), "approved"), DataEntry("dao_mwg_members", newGroup), DataEntry("dao_mwg_size", newGroupSize)]) | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(i) | |
129 | 129 | func wmgMembershipVoteForDAOMember (candidateAddress,voteValue) = { | |
130 | 130 | let membershipAddress = toString(i.caller) | |
131 | 131 | let voteValueInt = getVoteValue(voteValue) | |
132 | 132 | let votingKey = (("dao_member_" + candidateAddress) + "_vote") | |
133 | 133 | let votedKey = (("dao_member_" + candidateAddress) + "_voted") | |
134 | 134 | let votedVal = match getString(this, votedKey) { | |
135 | 135 | case b: String => | |
136 | 136 | b | |
137 | 137 | case _ => | |
138 | 138 | "" | |
139 | 139 | } | |
140 | 140 | let votingState = tryGetInteger(votingKey) | |
141 | 141 | let newVotingState = (votingState + voteValueInt) | |
142 | 142 | if (isMembershipWorkingGroup(i.caller)) | |
143 | 143 | then if (isMembershipVotedForCandidate(membershipAddress, candidateAddress)) | |
144 | 144 | then throw("You have already voted") | |
145 | 145 | else WriteSet([DataEntry(((membershipAddress + "_voted_") + candidateAddress), 1), DataEntry(votingKey, newVotingState), DataEntry(votedKey, votedVal)]) | |
146 | 146 | else throw("You have no rights") | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 |
github/deemru/w8io/026f985 28.06 ms ◑