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