tx · 51hHH8NPdqoeUSjQtvvaJUmsL6QTuueBp6cBjWDnvu6W 3N3PDiDHb1AJU8tTXJLcvoDNP29fdGNNWqs: -0.05000000 Waves 2019.12.30 10:58 [831551] smart account 3N3PDiDHb1AJU8tTXJLcvoDNP29fdGNNWqs > SELF 0.00000000 Waves
{ "type": 13, "id": "51hHH8NPdqoeUSjQtvvaJUmsL6QTuueBp6cBjWDnvu6W", "fee": 5000000, "feeAssetId": null, "timestamp": 1577692649537, "version": 1, "sender": "3N3PDiDHb1AJU8tTXJLcvoDNP29fdGNNWqs", "senderPublicKey": "5uHVezdnBEVjiWnLWW7VW2bPp8P5h6zdbha2dfHgHytt", "proofs": [ "5QagNiszpW5WMYMxnKAnmDjVbXzYt6tPHfdEGrf9AgmmsSayViE3PzQrvjB3Kf97H1cW4uUogDfWf5vSoFkCgrqY" ], "script": "base64:AAIDAAAAAAAAADwIARIDCgEBEgUKAwgBCBIDCgEIEgQKAggIEgUKAwgICBIECgIICBIDCgEIEgMKAQgSBAoCCAQSBAoCCAEAAAAtAAAAAAROT05FAgAAAARub25lAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAABERBUFACAAAAAAAAAAADTU9EAgAAAANtb2QAAAAAClJFR0lTVEVSRUQCAAAACnJlZ2lzdGVyZWQAAAAAB0NSRUFUT1ICAAAAIzNNc1RMaXpFZzR2cU5nRDdaVmpoa1BhWmdzck4xMUpxekxKAAAAAApJTlBST0dSRVNTAgAAAAtpbiBwcm9ncmVzcwAAAAAJQ09NUExFVEVEAgAAAAljb21wbGV0ZWQAAAAAB1BFTkRJTkcCAAAAB3BlbmRpbmcAAAAACUlORElTUFVURQIAAAAKaW4gZGlzcHV0ZQAAAAAIUkVWSVNJT04CAAAACHJldmlzaW9uAAAAAApERUNSWUJFRkVFAAAAAAAAAAACAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAA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Y2FuIG9ubHkgYmUgbW92ZWQgZm9yd2FyZAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAFGdldEtleVRhc2tFeHBpcmF0aW9uAAAAAQUAAAAEdGFzawUAAAAIZGVhZGxpbmUFAAAAA25pbAAAAACVBCZE", "chainId": 84, "height": 831551, "spentComplexity": 0 } View: original | compacted Prev: 3sYErr8PuGXqJ8nZmNorBibEGbMADqdqwqYqKX7J6QZ7 Next: 8pusnTpWde81VZhmwuhcMRHT5BGYmUjKmXkPG1GucGiG Diff:
Old | New | Differences | |
---|---|---|---|
158 | 158 | let account = toBase58String(i.caller.bytes) | |
159 | 159 | let pmt = extract(i.payment) | |
160 | 160 | let pmtAmount = pmt.amount | |
161 | - | let commission = (pmtAmount * | |
161 | + | let commission = ((pmtAmount * DECRYBEFEE) / 100) | |
162 | 162 | let payment = (pmtAmount - commission) | |
163 | 163 | if (isDefined(pmt.assetId)) | |
164 | 164 | then throw("Can use waves only at the moment") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "none" | |
5 | 5 | ||
6 | 6 | let FEATURED = "featured" | |
7 | 7 | ||
8 | 8 | let DAPP = "" | |
9 | 9 | ||
10 | 10 | let MOD = "mod" | |
11 | 11 | ||
12 | 12 | let REGISTERED = "registered" | |
13 | 13 | ||
14 | 14 | let CREATOR = "3MsTLizEg4vqNgD7ZVjhkPaZgsrN11JqzLJ" | |
15 | 15 | ||
16 | 16 | let INPROGRESS = "in progress" | |
17 | 17 | ||
18 | 18 | let COMPLETED = "completed" | |
19 | 19 | ||
20 | 20 | let PENDING = "pending" | |
21 | 21 | ||
22 | 22 | let INDISPUTE = "in dispute" | |
23 | 23 | ||
24 | 24 | let REVISION = "revision" | |
25 | 25 | ||
26 | 26 | let DECRYBEFEE = 2 | |
27 | 27 | ||
28 | 28 | func getStrByKey (key) = { | |
29 | 29 | let str = match getString(this, key) { | |
30 | 30 | case a: String => | |
31 | 31 | a | |
32 | 32 | case _ => | |
33 | 33 | NONE | |
34 | 34 | } | |
35 | 35 | str | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func getNumberByKey (key) = { | |
40 | 40 | let num = match getInteger(this, key) { | |
41 | 41 | case a: Int => | |
42 | 42 | a | |
43 | 43 | case _ => | |
44 | 44 | 0 | |
45 | 45 | } | |
46 | 46 | num | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func getKeyUserMessagesCnt (from,to) = ((("msg_cnt_" + from) + "_") + to) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func getValueUserMessagesCnt (from,to) = getNumberByKey(getKeyUserMessagesCnt(from, to)) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getKeyUserMessage (from,to,id) = ((((("msg_" + from) + "_") + to) + "_id:") + id) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getValueUserMessage (from,to,cnt) = getStrByKey(getKeyUserMessage(from, to, cnt)) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getKeyUserMessageBlock (from,to,cnt) = ((((("block_msg_" + from) + "_") + to) + "_id:") + cnt) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getValueUserMessageBlock (from,to,cnt) = getStrByKey(getKeyUserMessageBlock(from, to, cnt)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getKeyTaskData (task) = ("datajson_" + task) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getValueTaskData (task) = getStrByKey(getKeyTaskData(task)) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getKeyTaskAuthor (task) = ("author_" + task) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func getValueTaskAuthor (task) = getStrByKey(getKeyTaskAuthor(task)) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func getKeyTaskBlock (task) = ("block_" + task) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func getValueTaskBlock (task) = getNumberByKey(getKeyTaskBlock(task)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getKeyTaskBank (task) = ("bank_" + task) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func getValueTaskBank (task) = getNumberByKey(getKeyTaskBank(task)) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func getKeyTaskFreelancer (task) = ("freelancer_" + task) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getValueTaskFreelancer (task) = getStrByKey(getKeyTaskFreelancer(task)) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getKeyTaskStatus (task) = ("status_" + task) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func getValueTaskStatus (task) = getStrByKey(getKeyTaskStatus(task)) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getKeyTaskExpiration (task) = ("expiration_block_" + task) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func getValueTaskExpiration (task) = getNumberByKey(getKeyTaskExpiration(task)) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func getKeyUserBio (account) = ("user_bio_" + account) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getValueUserBio (account) = getStrByKey(getKeyUserBio(account)) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getKeyUserStatus (account) = ("user_sts_" + account) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getValueUserStatus (account) = getStrByKey(getKeyUserStatus(account)) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func getKeyUserBlock (account) = ("user_blk_" + account) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getKeyTaskReportComplete (freelancer,task,stage) = ((((("rc_" + task) + "_") + freelancer) + "_stage:") + stage) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func getValueTaskReportComplete (freelancer,task,stage) = getStrByKey(getKeyTaskReportComplete(freelancer, task, stage)) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func getKeyTaskReportCompleteCnt (task,freelancer) = ((("rc_cnt_" + task) + "_") + freelancer) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func getValueTaskReportCompleteCnt (task,freelancer) = getNumberByKey(getKeyTaskReportCompleteCnt(task, freelancer)) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func getKeyDecrybeBalance () = "decrybe_balance" | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func getValueDecrybeBalance () = getNumberByKey(getKeyDecrybeBalance()) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | @Callable(i) | |
144 | 144 | func withdrawDecrybeBalance (amount) = { | |
145 | 145 | let account = toBase58String(i.caller.bytes) | |
146 | 146 | let balance = getValueDecrybeBalance() | |
147 | 147 | if ((account == CREATOR)) | |
148 | 148 | then if ((balance >= amount)) | |
149 | 149 | then TransferSet([ScriptTransfer(addressFromStringValue(account), amount, unit)]) | |
150 | 150 | else throw(("You cannot withdraw an amount greater than " + toString(balance))) | |
151 | 151 | else throw("You can't do that") | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | ||
156 | 156 | @Callable(i) | |
157 | 157 | func createTask (task,expiration,data) = { | |
158 | 158 | let account = toBase58String(i.caller.bytes) | |
159 | 159 | let pmt = extract(i.payment) | |
160 | 160 | let pmtAmount = pmt.amount | |
161 | - | let commission = (pmtAmount * | |
161 | + | let commission = ((pmtAmount * DECRYBEFEE) / 100) | |
162 | 162 | let payment = (pmtAmount - commission) | |
163 | 163 | if (isDefined(pmt.assetId)) | |
164 | 164 | then throw("Can use waves only at the moment") | |
165 | 165 | else if ((pmtAmount == 0)) | |
166 | 166 | then throw("Amount must be higher then 0") | |
167 | 167 | else if ((getValueTaskAuthor(task) != NONE)) | |
168 | 168 | then throw("Task already exist") | |
169 | 169 | else if ((getValueUserBio(account) == NONE)) | |
170 | 170 | then throw("User not signup") | |
171 | 171 | else WriteSet([DataEntry(getKeyTaskAuthor(task), account), DataEntry(getKeyTaskBlock(task), height), DataEntry(getKeyTaskExpiration(task), (height + expiration)), DataEntry(getKeyTaskBank(task), payment), DataEntry(getKeyTaskStatus(task), FEATURED), DataEntry(getKeyTaskData(task), data), DataEntry(getKeyDecrybeBalance(), (getValueDecrybeBalance() + commission))]) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func signUp (data) = { | |
178 | 178 | let account = toBase58String(i.caller.bytes) | |
179 | 179 | if ((getValueUserBio(account) != NONE)) | |
180 | 180 | then throw("User already exist") | |
181 | 181 | else WriteSet([DataEntry(getKeyUserBio(account), data), DataEntry(getKeyUserBlock(account), height), DataEntry(getKeyUserStatus(account), REGISTERED)]) | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | ||
186 | 186 | @Callable(i) | |
187 | 187 | func hireFreelancer (task,freelancer) = { | |
188 | 188 | let account = toBase58String(i.caller.bytes) | |
189 | 189 | if ((getValueTaskData(task) == NONE)) | |
190 | 190 | then throw("Task doesnt exist") | |
191 | 191 | else if ((getValueUserBio(account) == NONE)) | |
192 | 192 | then throw("Customer not signup") | |
193 | 193 | else if ((getValueUserBio(freelancer) == NONE)) | |
194 | 194 | then throw("Freelancer not signup") | |
195 | 195 | else if ((getValueTaskAuthor(task) != account)) | |
196 | 196 | then throw("You're not author") | |
197 | 197 | else if ((getValueTaskStatus(task) == INPROGRESS)) | |
198 | 198 | then throw("Freelancer is no longer required (the task is already in progress)") | |
199 | 199 | else if ((freelancer == account)) | |
200 | 200 | then throw("You can't hire yourself") | |
201 | 201 | else WriteSet([DataEntry(getKeyTaskFreelancer(task), freelancer), DataEntry(getKeyTaskStatus(task), INPROGRESS)]) | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | ||
206 | 206 | @Callable(i) | |
207 | 207 | func sendMessage (task,to,message) = { | |
208 | 208 | let account = toBase58String(i.caller.bytes) | |
209 | 209 | let cnt = (getValueUserMessagesCnt(account, to) + 1) | |
210 | 210 | if ((getValueTaskData(task) == NONE)) | |
211 | 211 | then throw("Task doesnt exist") | |
212 | 212 | else if ((account == to)) | |
213 | 213 | then throw("You can't send messages to yourself") | |
214 | 214 | else if ((getValueUserBio(account) == NONE)) | |
215 | 215 | then throw("Sender not signup") | |
216 | 216 | else if ((getValueUserBio(to) == NONE)) | |
217 | 217 | then throw("Recipient not singup") | |
218 | 218 | else WriteSet([DataEntry(getKeyUserMessagesCnt(account, to), cnt), DataEntry(getKeyUserMessage(account, to, toString(cnt)), message), DataEntry(getKeyUserMessageBlock(account, to, toString(cnt)), height)]) | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func taskUpdate (task,data) = { | |
225 | 225 | let account = toBase58String(i.caller.bytes) | |
226 | 226 | if ((getValueTaskData(task) == NONE)) | |
227 | 227 | then throw("Task doesnt exist") | |
228 | 228 | else if ((getValueTaskAuthor(task) != account)) | |
229 | 229 | then throw("You're not author") | |
230 | 230 | else if ((getValueTaskStatus(task) == INPROGRESS)) | |
231 | 231 | then throw("Editing tasks is not available after hiring a freelancer") | |
232 | 232 | else WriteSet([DataEntry(getKeyTaskData(task), data)]) | |
233 | 233 | } | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | ||
237 | 237 | @Callable(i) | |
238 | 238 | func userUpdate (data) = { | |
239 | 239 | let account = toBase58String(i.caller.bytes) | |
240 | 240 | if ((getValueUserBio(account) == NONE)) | |
241 | 241 | then throw("User not signup") | |
242 | 242 | else WriteSet([DataEntry(getKeyUserBio(account), data)]) | |
243 | 243 | } | |
244 | 244 | ||
245 | 245 | ||
246 | 246 | ||
247 | 247 | @Callable(i) | |
248 | 248 | func reportCompleteTask (task) = { | |
249 | 249 | let account = toBase58String(i.caller.bytes) | |
250 | 250 | let stage = (getValueTaskReportCompleteCnt(task, account) + 1) | |
251 | 251 | let taskCreator = getValueTaskAuthor(task) | |
252 | 252 | let status = getValueTaskStatus(task) | |
253 | 253 | let freelancerMessagesCnt = getValueUserMessagesCnt(account, taskCreator) | |
254 | 254 | let lastFreelancerMessage = getValueUserMessage(account, taskCreator, toString(freelancerMessagesCnt)) | |
255 | 255 | if ((getValueTaskFreelancer(task) == account)) | |
256 | 256 | then if ((status == INPROGRESS)) | |
257 | 257 | then WriteSet([DataEntry(getKeyTaskReportComplete(account, task, toString(stage)), freelancerMessagesCnt), DataEntry(getKeyTaskStatus(task), PENDING)]) | |
258 | 258 | else if ((status == COMPLETED)) | |
259 | 259 | then throw("You've already been paid for your work") | |
260 | 260 | else throw("The work is awaiting approval") | |
261 | 261 | else if ((getValueTaskFreelancer(task) == NONE)) | |
262 | 262 | then throw("Task freelancer doesnt exist") | |
263 | 263 | else if ((getValueTaskAuthor(task) == account)) | |
264 | 264 | then throw("You are author") | |
265 | 265 | else throw("Error #1") | |
266 | 266 | } | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | ||
270 | 270 | @Callable(i) | |
271 | 271 | func acceptWork (task,complete) = { | |
272 | 272 | let account = toBase58String(i.caller.bytes) | |
273 | 273 | let creator = getValueTaskAuthor(task) | |
274 | 274 | let freelancer = getValueTaskFreelancer(task) | |
275 | 275 | let stage = getValueTaskReportCompleteCnt(task, freelancer) | |
276 | 276 | let status = getValueTaskStatus(task) | |
277 | 277 | let bank = getValueTaskBank(task) | |
278 | 278 | if ((account == creator)) | |
279 | 279 | then if ((status == PENDING)) | |
280 | 280 | then if (complete) | |
281 | 281 | then ScriptResult(WriteSet([DataEntry(getKeyTaskStatus(task), COMPLETED)]), TransferSet([ScriptTransfer(addressFromStringValue(freelancer), bank, unit)])) | |
282 | 282 | else WriteSet([DataEntry(getKeyTaskStatus(task), INPROGRESS)]) | |
283 | 283 | else throw("Freelancer doesnt complete the task") | |
284 | 284 | else if ((getValueTaskData(task) == NONE)) | |
285 | 285 | then throw("Task doesnt exist") | |
286 | 286 | else if ((getValueUserBio(account) == NONE)) | |
287 | 287 | then throw("Sender not signup") | |
288 | 288 | else throw("You are not author") | |
289 | 289 | } | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | ||
293 | 293 | @Callable(i) | |
294 | 294 | func moveDeadline (task,deadline) = { | |
295 | 295 | let account = toBase58String(i.caller.bytes) | |
296 | 296 | let creator = getValueTaskAuthor(task) | |
297 | 297 | let expiration = getValueTaskExpiration(task) | |
298 | 298 | let status = getValueTaskStatus(task) | |
299 | 299 | if ((status != COMPLETED)) | |
300 | 300 | then throw("The task is completed") | |
301 | 301 | else if ((status == INDISPUTE)) | |
302 | 302 | then throw("You can't change the deadline at this time") | |
303 | 303 | else if ((account != creator)) | |
304 | 304 | then throw("You are not author of the task") | |
305 | 305 | else if ((height > deadline)) | |
306 | 306 | then throw("The deadline must be > the current block") | |
307 | 307 | else if ((expiration > deadline)) | |
308 | 308 | then throw("The deadline can only be moved forward") | |
309 | 309 | else WriteSet([DataEntry(getKeyTaskExpiration(task), deadline)]) | |
310 | 310 | } | |
311 | 311 | ||
312 | 312 |
github/deemru/w8io/169f3d6 51.43 ms ◑