tx · 3GGPJsUJoSxF9zhWFjYoEJKQKwMc2tA1zxPZ9uQ5HDRj 3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ: -0.10000000 Waves 2020.12.01 17:16 [1289707] smart account 3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ > SELF 0.00000000 Waves
{ "type": 13, "id": "3GGPJsUJoSxF9zhWFjYoEJKQKwMc2tA1zxPZ9uQ5HDRj", "fee": 10000000, "feeAssetId": null, "timestamp": 1606832163240, "version": 2, "chainId": 84, "sender": "3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ", "senderPublicKey": "3Fjao2FW1JXSPd5EkP7C3uerW18HYacYsaMYALFMGA6N", "proofs": [ "4gHPqf7ysAoCdSuiuKsH3yQLyyeNSCxH8yQLgmhR7NSnvtMZzNQ37FqkpPHRCEQGoDN26Qc9BV8KjynBJ4pyDUKZ" ], "script": "base64:AAIDAAAAAAAAADMIARIDCgEIEgQKAggIEgQKAggBEgMKAQgSBAoCCAESAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAJAAAAAAZRVU9SVU0AAAAAAAAAAAEBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAAAAAAxtYWluQ29udHJhY3QFAAAABHRoaXMBAAAAB2lzT3duZXIAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRk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ANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAdfcmVwb3J0BQAAAApyZXBvcnRMaW5rBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAt0ZWFtQWRkcmVzcwUAAAAMcmV3YXJkQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAYSLyxw==", "height": 1289707, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5uBktXog3ByE1idHffyb4MYdrjQcr9nEfqceXndzDaVm Next: Hhn1n26oo6JW7YFJKRn1CqotunjTntxXRLESVw5ufRBH Diff:
Old | New | Differences | |
---|---|---|---|
72 | 72 | } | |
73 | 73 | (val > 0) | |
74 | 74 | } | |
75 | + | ||
76 | + | ||
77 | + | @Callable(i) | |
78 | + | func test (title) = WriteSet([DataEntry((("test_" + toBase58String(i.transactionId)) + "_title"), title)]) | |
79 | + | ||
75 | 80 | ||
76 | 81 | ||
77 | 82 | @Callable(i) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let QUORUM = 1 | |
5 | 5 | ||
6 | 6 | func tryGetInteger (key) = { | |
7 | 7 | let val = match getInteger(this, key) { | |
8 | 8 | case b: Int => | |
9 | 9 | b | |
10 | 10 | case _ => | |
11 | 11 | 0 | |
12 | 12 | } | |
13 | 13 | val | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func tryGetString (key) = { | |
18 | 18 | let val = match getString(this, key) { | |
19 | 19 | case b: String => | |
20 | 20 | b | |
21 | 21 | case _ => | |
22 | 22 | "" | |
23 | 23 | } | |
24 | 24 | val | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | let mainContract = this | |
29 | 29 | ||
30 | 30 | func isOwner (address) = (address == this) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getGroup () = { | |
34 | 34 | let val = match getString(mainContract, "working_group_members") { | |
35 | 35 | case b: String => | |
36 | 36 | b | |
37 | 37 | case _ => | |
38 | 38 | "" | |
39 | 39 | } | |
40 | 40 | val | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getMembers () = { | |
45 | 45 | let val = match getString(mainContract, "dao_members") { | |
46 | 46 | case b: String => | |
47 | 47 | b | |
48 | 48 | case _ => | |
49 | 49 | "" | |
50 | 50 | } | |
51 | 51 | val | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func isGroupMember (a) = { | |
56 | 56 | let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) { | |
57 | 57 | case b: Int => | |
58 | 58 | b | |
59 | 59 | case _ => | |
60 | 60 | 0 | |
61 | 61 | } | |
62 | 62 | (val > 0) | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func canMemberVote (i) = { | |
67 | 67 | let val = match getInteger(mainContract, (("dao_member_" + toString(i.caller)) + "_weight")) { | |
68 | 68 | case b: Int => | |
69 | 69 | b | |
70 | 70 | case _ => | |
71 | 71 | 0 | |
72 | 72 | } | |
73 | 73 | (val > 0) | |
74 | 74 | } | |
75 | + | ||
76 | + | ||
77 | + | @Callable(i) | |
78 | + | func test (title) = WriteSet([DataEntry((("test_" + toBase58String(i.transactionId)) + "_title"), title)]) | |
79 | + | ||
75 | 80 | ||
76 | 81 | ||
77 | 82 | @Callable(i) | |
78 | 83 | func addTask (title,link) = WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
79 | 84 | ||
80 | 85 | ||
81 | 86 | ||
82 | 87 | @Callable(i) | |
83 | 88 | func addTaskDetails (taskId,reward) = { | |
84 | 89 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
85 | 90 | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
86 | 91 | then throw("team leader only") | |
87 | 92 | else WriteSet([DataEntry((("tasks_" + taskId) + "_requestedreward"), reward)]) | |
88 | 93 | } | |
89 | 94 | ||
90 | 95 | ||
91 | 96 | ||
92 | 97 | @Callable(i) | |
93 | 98 | func initTaskVoting (taskId) = if (!(isGroupMember(i.caller))) | |
94 | 99 | then throw("grants working group access only") | |
95 | 100 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "voting_started")]) | |
96 | 101 | ||
97 | 102 | ||
98 | 103 | ||
99 | 104 | @Callable(i) | |
100 | 105 | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
101 | 106 | then throw("you can't vote") | |
102 | 107 | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
103 | 108 | then throw("voting is closed or not started") | |
104 | 109 | else if (if ((voteValue != -1)) | |
105 | 110 | then (voteValue != 1) | |
106 | 111 | else false) | |
107 | 112 | then throw("you need to vote 1 or -1") | |
108 | 113 | else { | |
109 | 114 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
110 | 115 | let previousVote = tryGetInteger(voteKey) | |
111 | 116 | if (!((previousVote == 0))) | |
112 | 117 | then throw("you have already voted") | |
113 | 118 | else { | |
114 | 119 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
115 | 120 | let votingState = tryGetInteger(votingKey) | |
116 | 121 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
117 | 122 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
118 | 123 | let newVotingState = (votingState + voteValue) | |
119 | 124 | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
120 | 125 | } | |
121 | 126 | } | |
122 | 127 | ||
123 | 128 | ||
124 | 129 | ||
125 | 130 | @Callable(i) | |
126 | 131 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
127 | 132 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
128 | 133 | else if (!(isGroupMember(i.caller))) | |
129 | 134 | then throw("grants working group access only") | |
130 | 135 | else { | |
131 | 136 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
132 | 137 | let votingState = tryGetInteger(votingKey) | |
133 | 138 | if ((votingState > 0)) | |
134 | 139 | then { | |
135 | 140 | let votingResult = "approved" | |
136 | 141 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
137 | 142 | } | |
138 | 143 | else { | |
139 | 144 | let votingResult = "rejected" | |
140 | 145 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
141 | 146 | } | |
142 | 147 | } | |
143 | 148 | ||
144 | 149 | ||
145 | 150 | ||
146 | 151 | @Callable(i) | |
147 | 152 | func startWork (taskId) = { | |
148 | 153 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
149 | 154 | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
150 | 155 | then throw("team leader only") | |
151 | 156 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started")]) | |
152 | 157 | } | |
153 | 158 | ||
154 | 159 | ||
155 | 160 | ||
156 | 161 | @Callable(i) | |
157 | 162 | func rejectTask (taskId) = if (!(isGroupMember(i.caller))) | |
158 | 163 | then throw("grants working group access only") | |
159 | 164 | else { | |
160 | 165 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
161 | 166 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "rejected")]) | |
162 | 167 | } | |
163 | 168 | ||
164 | 169 | ||
165 | 170 | ||
166 | 171 | @Callable(i) | |
167 | 172 | func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller))) | |
168 | 173 | then throw("grants working group access only") | |
169 | 174 | else { | |
170 | 175 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
171 | 176 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
172 | 177 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
173 | 178 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
174 | 179 | } | |
175 | 180 | ||
176 | 181 |
github/deemru/w8io/169f3d6 37.06 ms ◑