tx · XwbWHe6CRv7UW9VBGvdBDMvEohFqZhiJYoHnVN1vSqP 3MpPu1ga8bDqj9QdffpMGoCkuRvpYWiNUFN: -0.01000000 Waves 2020.05.16 12:13 [1000586] smart account 3MpPu1ga8bDqj9QdffpMGoCkuRvpYWiNUFN > SELF 0.00000000 Waves
{ "type": 13, "id": "XwbWHe6CRv7UW9VBGvdBDMvEohFqZhiJYoHnVN1vSqP", "fee": 1000000, "feeAssetId": null, "timestamp": 1589620416016, "version": 1, "sender": "3MpPu1ga8bDqj9QdffpMGoCkuRvpYWiNUFN", "senderPublicKey": "GCox9sqYGTvE4hj3kne31XEJw4nKk6emMvuWTVku6wSR", "proofs": [ "5oXxWG74oN313SKPBaLyJNEyZ7p51Jm3pEAQpNfsgnXTEVffwGEfZ9aLxYX6TXYfSW2L3h3acgDwq41sxsVMeHtm" ], "script": "base64:AAIDAAAAAAAAABwIARINCgsICAEBAQgICAEBCBIJCgcBCAEBAQEBAAAARwAAAAAXcmVzY3VlVGltZUNvbmRpdGlvbkxlc3MCAAAABGxlc3MAAAAAF3Jlc2N1ZVRpbWVDb25kaXRpb25Nb3JlAgAAAARtb3JlAAAAACByZXNjdWVUaW1lQ2F0ZWdvcnlWZXJ5UHJvZHVjdGl2ZQIAAAAOdmVyeVByb2R1Y3RpdmUAAAAAHHJlc2N1ZVRpbWVDYXRlZ29yeVByb2R1Y3RpdmUCAAAACnByb2R1Y3RpdmUAAAAAGXJlc2N1ZVRpbWVDYXRlZ29yeU5ldXRyYWwCAAAAB25ldXRyYWwAAAAAHXJlc2N1ZVRpbWVDYXRlZ29yeURpc3RyYWN0aW5nAgAAAAtkaXN0cmFjdGluZwAAAAAhcmVzY3VlVGltZUNhdGVnb3J5VmVyeURpc3RyYWN0aW5nAgAAAA92ZXJ5RGlzdHJhY3RpbmcAAAAAEWdvYWxTdGF0dXNQZW5kaW5nAgAAAAdwZW5kaW5nAAAAABBnb2FsU3RhdHVzQWN0aXZlAgAAAAZhY3RpdmUAAAA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VzAAAAAAAAAAABCQAETAAAAAIJAAGRAAAAAgUAAAARY2F0ZWdvcmllc0VudHJpZXMAAAAAAAAAAAIJAARMAAAAAgkAAZEAAAACBQAAABFjYXRlZ29yaWVzRW50cmllcwAAAAAAAAAAAwkABEwAAAACCQABkQAAAAIFAAAAEWNhdGVnb3JpZXNFbnRyaWVzAAAAAAAAAAAEBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAASdXNlckFjY291bnRBZGRyZXNzBQAAAANiZXQJAAJZAAAAAQUAAAAKYmV0QXNzZXRJZAUAAAADbmlsCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAABBzZXRJbnRlZ2VyUmVjb3JkAAAAAgUAAAANZmFpbHNDb3VudEtleQUAAAAKZmFpbHNDb3VudAkABEwAAAACCQEAAAAPc2V0U3RyaW5nUmVjb3JkAAAAAgUAAAAPcmVjb3JkU3RhdHVzS2V5BQAAAAxyZWNvcmRTdGF0dXMJAARMAAAAAgkAAZEAAAACBQAAABFjYXRlZ29yaWVzRW50cmllcwAAAAAAAAAAAAkABEwAAAACCQABkQAAAAIFAAAAEWNhdGVnb3JpZXNFbnRyaWVzAAAAAAAAAAABCQAETAAAAAIJAAGRAAAAAgUAAAARY2F0ZWdvcmllc0VudHJpZXMAAAAAAAAAAAIJAARMAAAAAgkAAZEAAAACBQAAABFjYXRlZ29yaWVzRW50cmllcwAAAAAAAAAAAwkABEwAAAACCQABkQAAAAIFAAAAEWNhdGVnb3JpZXNFbnRyaWVzAAAAAAAAAAAEBQAAAANuaWwAAAAARWWG7g==", "chainId": 84, "height": 1000586, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let rescueTimeConditionLess = "less" | |
5 | + | ||
6 | + | let rescueTimeConditionMore = "more" | |
7 | + | ||
8 | + | let rescueTimeCategoryVeryProductive = "veryProductive" | |
9 | + | ||
10 | + | let rescueTimeCategoryProductive = "productive" | |
11 | + | ||
12 | + | let rescueTimeCategoryNeutral = "neutral" | |
13 | + | ||
14 | + | let rescueTimeCategoryDistracting = "distracting" | |
15 | + | ||
16 | + | let rescueTimeCategoryVeryDistracting = "veryDistracting" | |
17 | + | ||
18 | + | let goalStatusPending = "pending" | |
19 | + | ||
20 | + | let goalStatusActive = "active" | |
21 | + | ||
22 | + | let goalStatusPause = "pause" | |
23 | + | ||
24 | + | let goalStatusSuccess = "success" | |
25 | + | ||
26 | + | let goalStatusFail = "fail" | |
27 | + | ||
28 | + | let recordStatusPending = "pending" | |
29 | + | ||
30 | + | let recordStatusSuccess = "success" | |
31 | + | ||
32 | + | let recordStatusFail = "fail" | |
33 | + | ||
34 | + | let integrationServicesRescueTime = "rescueTime" | |
35 | + | ||
36 | + | let weekDayMonday = "monday" | |
37 | + | ||
38 | + | let weekDayTuesday = "tuesday" | |
39 | + | ||
40 | + | let weekDayWednesday = "wednesday" | |
41 | + | ||
42 | + | let weekDayThursday = "thursday" | |
43 | + | ||
44 | + | let weekDayFriday = "friday" | |
45 | + | ||
46 | + | let weekDaySaturday = "saturday" | |
47 | + | ||
48 | + | let weekDaySunday = "sunday" | |
49 | + | ||
50 | + | let nameKey = "name" | |
51 | + | ||
52 | + | let descriptionKey = "description" | |
53 | + | ||
54 | + | let startDateKey = "startDate" | |
55 | + | ||
56 | + | let endDateKey = "endDate" | |
57 | + | ||
58 | + | let rescueTimeConditionAmountKey = "rescueTimeConditionAmount" | |
59 | + | ||
60 | + | let rescueTimeConditionKey = "rescueTimeCondition" | |
61 | + | ||
62 | + | let rescueTimeCategoryKey = "rescueTimeCategory" | |
63 | + | ||
64 | + | let trackWeekDaysKey = "trackWeekDays" | |
65 | + | ||
66 | + | let attempsCountKey = "attempsCount" | |
67 | + | ||
68 | + | let betKey = "bet" | |
69 | + | ||
70 | + | let betAssetIdKey = "betAssetId" | |
71 | + | ||
72 | + | let goalStatusKey = "goalStatus" | |
73 | + | ||
74 | + | let failsCountKey = "failsCount" | |
75 | + | ||
76 | + | let adminAccountPublicKey = base58'GtDLBooknaE8G983yMjhygiyhmpR5tebBScKPw277tj9' | |
77 | + | ||
78 | + | let userAccountPublicKey = base58'BNPWfnwQQaiG9SxwTXqNi5sRA5oAU2M4QvQUAoGrnNbf' | |
79 | + | ||
80 | + | let goalAccountPublicKey = base58'GCox9sqYGTvE4hj3kne31XEJw4nKk6emMvuWTVku6wSR' | |
81 | + | ||
82 | + | func throwUndefinedError () = throw("undefinedError") | |
83 | + | ||
84 | + | ||
85 | + | func throwOutdatedGoalError () = throw("outdatedGoalError") | |
86 | + | ||
87 | + | ||
88 | + | func throwNotTrackWeekDayError () = throw("notTrackWeekDay") | |
89 | + | ||
90 | + | ||
91 | + | func throwNotActiveGoalError () = throw("notActiveGoalError") | |
92 | + | ||
93 | + | ||
94 | + | func throwGoalRecordAlreadyAddedError () = throw("goalRecordAlreadyAdded") | |
95 | + | ||
96 | + | ||
97 | + | func throwIsNotAdminCallerError () = throw("isNotAdminCallerError") | |
98 | + | ||
99 | + | ||
100 | + | func throwIsNotUserCallerError () = throw("isNotUserCallerError") | |
101 | + | ||
102 | + | ||
103 | + | func throwIsNotGoalCallerError () = throw("isNotGoalCallerError") | |
104 | + | ||
105 | + | ||
106 | + | let noPaymentError = "noPaymentError" | |
107 | + | ||
108 | + | func throwUnsupportedEventPaymentAssetError (expectedAsset,receivedAsset) = throw((((("unsupportedEventPaymentAssetError" + ",") + toBase58String(expectedAsset)) + ",") + toBase58String(receivedAsset))) | |
109 | + | ||
110 | + | ||
111 | + | func throwInsufficientPaymentError (expectedPaymentAmount,receivedPaymentAmount) = throw((((("insufficientPaymentError" + ",") + toString(expectedPaymentAmount)) + ",") + toString(receivedPaymentAmount))) | |
112 | + | ||
113 | + | ||
114 | + | func getIntegerRecordOr (accountAddress,key,default) = if (isDefined(getInteger(this, key))) | |
115 | + | then getIntegerValue(this, key) | |
116 | + | else default | |
117 | + | ||
118 | + | ||
119 | + | func getIntegerRecord (accountAddress,key) = getIntegerValue(this, key) | |
120 | + | ||
121 | + | ||
122 | + | func setIntegerRecord (key,value) = DataEntry(key, value) | |
123 | + | ||
124 | + | ||
125 | + | func getStringOr (accountAddress,key,default) = if (isDefined(getString(this, key))) | |
126 | + | then getStringValue(this, key) | |
127 | + | else default | |
128 | + | ||
129 | + | ||
130 | + | func getStringRecord (accountAddress,key) = getStringValue(this, key) | |
131 | + | ||
132 | + | ||
133 | + | func setStringRecord (key,value) = DataEntry(key, value) | |
134 | + | ||
135 | + | ||
136 | + | func getBooleanRecord (accountAddress,key) = getBooleanValue(this, key) | |
137 | + | ||
138 | + | ||
139 | + | func setBooleanRecord (key,value) = DataEntry(key, value) | |
140 | + | ||
141 | + | ||
142 | + | func getBinaryRecord (accountAddress,key) = getBinaryValue(this, key) | |
143 | + | ||
144 | + | ||
145 | + | func setBinaryRecord (key,value) = DataEntry(key, value) | |
146 | + | ||
147 | + | ||
148 | + | func isRecordDefined (key) = if (if (if (isDefined(getBinary(this, key))) | |
149 | + | then true | |
150 | + | else isDefined(getString(this, key))) | |
151 | + | then true | |
152 | + | else isDefined(getBoolean(this, key))) | |
153 | + | then true | |
154 | + | else isDefined(getInteger(this, key)) | |
155 | + | ||
156 | + | ||
157 | + | func isSubstrExist (str,substr) = match indexOf(str, substr) { | |
158 | + | case index: Int => | |
159 | + | true | |
160 | + | case index: Unit => | |
161 | + | false | |
162 | + | case _ => | |
163 | + | throw() | |
164 | + | } | |
165 | + | ||
166 | + | ||
167 | + | func getPayment (i) = valueOrErrorMessage(i.payment, noPaymentError) | |
168 | + | ||
169 | + | ||
170 | + | func getPaymentAssetId (payment) = match payment.assetId { | |
171 | + | case assetId: ByteVector => | |
172 | + | assetId | |
173 | + | case assetId: Unit => | |
174 | + | fromBase58String("WAVES") | |
175 | + | case _ => | |
176 | + | throw() | |
177 | + | } | |
178 | + | ||
179 | + | ||
180 | + | func getCategoryRecordKey (date,rescueTimeCategoryVeryProductive) = (((("record_<" + toString(date)) + ">__category_<") + rescueTimeCategoryVeryProductive) + ">") | |
181 | + | ||
182 | + | ||
183 | + | func getRecordStatusKey (date) = (("record_<" + toString(date)) + ">") | |
184 | + | ||
185 | + | ||
186 | + | func isAdminCaller (callerPublicKey) = { | |
187 | + | let callerAccountPubKey = toBase58String(callerPublicKey) | |
188 | + | let adminAccountPubKey = toBase58String(adminAccountPublicKey) | |
189 | + | if ((callerAccountPubKey == adminAccountPubKey)) | |
190 | + | then true | |
191 | + | else false | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | func isUserCaller (callerPublicKey) = { | |
196 | + | let callerAccountPubKey = toBase58String(callerPublicKey) | |
197 | + | let userAccountPubKey = toBase58String(userAccountPublicKey) | |
198 | + | if ((callerAccountPubKey == userAccountPubKey)) | |
199 | + | then true | |
200 | + | else false | |
201 | + | } | |
202 | + | ||
203 | + | ||
204 | + | func isGoalCaller (callerPublicKey) = { | |
205 | + | let callerAccountPubKey = toBase58String(callerPublicKey) | |
206 | + | let goalAccountPubKey = toBase58String(goalAccountPublicKey) | |
207 | + | if ((callerAccountPubKey == goalAccountPubKey)) | |
208 | + | then true | |
209 | + | else false | |
210 | + | } | |
211 | + | ||
212 | + | ||
213 | + | func getRecuetimeRecordStatus (date,veryProductive,productive,neutral,distracting,veryDistracting) = { | |
214 | + | let recordStatusKey = getRecordStatusKey(date) | |
215 | + | let rescueTimeConditionAmount = getIntegerRecordOr(this, rescueTimeConditionAmountKey, 0) | |
216 | + | let rescueTimeCondition = getStringValue(this, rescueTimeConditionKey) | |
217 | + | let rescueTimeCategory = getStringValue(this, rescueTimeCategoryKey) | |
218 | + | let conditionResult = if ((rescueTimeCondition == rescueTimeConditionLess)) | |
219 | + | then if ((rescueTimeCategory == rescueTimeCategoryVeryProductive)) | |
220 | + | then (rescueTimeConditionAmount >= veryProductive) | |
221 | + | else if ((rescueTimeCategory == rescueTimeCategoryProductive)) | |
222 | + | then (rescueTimeConditionAmount >= productive) | |
223 | + | else if ((rescueTimeCategory == rescueTimeCategoryNeutral)) | |
224 | + | then (rescueTimeConditionAmount >= neutral) | |
225 | + | else if ((rescueTimeCategory == rescueTimeCategoryDistracting)) | |
226 | + | then (rescueTimeConditionAmount >= distracting) | |
227 | + | else (rescueTimeConditionAmount >= veryDistracting) | |
228 | + | else if ((rescueTimeCategory == rescueTimeCategoryVeryProductive)) | |
229 | + | then (veryProductive >= rescueTimeConditionAmount) | |
230 | + | else if ((rescueTimeCategory == rescueTimeCategoryProductive)) | |
231 | + | then (productive >= rescueTimeConditionAmount) | |
232 | + | else if ((rescueTimeCategory == rescueTimeCategoryNeutral)) | |
233 | + | then (neutral >= rescueTimeConditionAmount) | |
234 | + | else if ((rescueTimeCategory == rescueTimeCategoryDistracting)) | |
235 | + | then (distracting >= rescueTimeConditionAmount) | |
236 | + | else (veryDistracting >= rescueTimeConditionAmount) | |
237 | + | if ((conditionResult == true)) | |
238 | + | then recordStatusSuccess | |
239 | + | else recordStatusFail | |
240 | + | } | |
241 | + | ||
242 | + | ||
243 | + | func getFailsCount (recordStatus) = { | |
244 | + | let failsCount = getIntegerValue(this, failsCountKey) | |
245 | + | if ((recordStatus == recordStatusSuccess)) | |
246 | + | then failsCount | |
247 | + | else (failsCount + 1) | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | @Callable(i) | |
252 | + | func setup (name,description,startDate,endDate,rescueTimeConditionAmount,rescueTimeCondition,rescueTimeCategory,trackWeekDays,attempsCount,bet,betAssetId) = { | |
253 | + | let payment = getPayment(i) | |
254 | + | let paymentAmount = payment.amount | |
255 | + | let paymentAssetId = getPaymentAssetId(payment) | |
256 | + | let isNotUserCaller = !(isUserCaller(i.callerPublicKey)) | |
257 | + | let isNotSupportedPaymentAsset = (paymentAssetId != fromBase58String(betAssetId)) | |
258 | + | let isInsufficientPayment = (paymentAmount != bet) | |
259 | + | if (isNotSupportedPaymentAsset) | |
260 | + | then throwUnsupportedEventPaymentAssetError(fromBase58String(betAssetId), paymentAssetId) | |
261 | + | else if (isInsufficientPayment) | |
262 | + | then throwInsufficientPaymentError(bet, paymentAmount) | |
263 | + | else if (isNotUserCaller) | |
264 | + | then throwIsNotUserCallerError() | |
265 | + | else WriteSet([setStringRecord(goalStatusKey, goalStatusActive), setStringRecord(nameKey, name), setStringRecord(descriptionKey, description), setIntegerRecord(startDateKey, startDate), setIntegerRecord(endDateKey, endDate), setIntegerRecord(rescueTimeConditionAmountKey, rescueTimeConditionAmount), setStringRecord(rescueTimeConditionKey, rescueTimeCondition), setStringRecord(rescueTimeCategoryKey, rescueTimeCategory), setStringRecord(trackWeekDaysKey, trackWeekDays), setIntegerRecord(attempsCountKey, attempsCount), setIntegerRecord(betKey, bet), setStringRecord(betAssetIdKey, betAssetId), setIntegerRecord(failsCountKey, 0)]) | |
266 | + | } | |
267 | + | ||
268 | + | ||
269 | + | ||
270 | + | @Callable(i) | |
271 | + | func addRecord (recordDateTimestamp,recordDateWeekDay,veryProductive,productive,neutral,distracting,veryDistracting) = { | |
272 | + | let recordStatusKey = getRecordStatusKey(recordDateTimestamp) | |
273 | + | let bet = getIntegerValue(this, betKey) | |
274 | + | let betAssetId = getStringValue(this, betAssetIdKey) | |
275 | + | let trackWeekDays = getStringValue(this, trackWeekDaysKey) | |
276 | + | let startDateTimestamp = getIntegerRecordOr(this, startDateKey, 0) | |
277 | + | let endDateTimestamp = getIntegerRecordOr(this, endDateKey, 0) | |
278 | + | let isOutdatedGoal = if ((startDateTimestamp > recordDateTimestamp)) | |
279 | + | then (recordDateTimestamp > endDateTimestamp) | |
280 | + | else false | |
281 | + | let isEndDate = (recordDateTimestamp == endDateTimestamp) | |
282 | + | let isNotActiveStatus = (getStringOr(this, goalStatusKey, goalStatusPending) != goalStatusActive) | |
283 | + | let isNotAdminCaller = !(isAdminCaller(i.callerPublicKey)) | |
284 | + | let isNotTrackWeekDay = !(isSubstrExist(trackWeekDays, recordDateWeekDay)) | |
285 | + | let isGoalRecordAlreadyAdded = isRecordDefined(recordStatusKey) | |
286 | + | if (isNotAdminCaller) | |
287 | + | then throwIsNotAdminCallerError() | |
288 | + | else if (isOutdatedGoal) | |
289 | + | then throwOutdatedGoalError() | |
290 | + | else if (isNotActiveStatus) | |
291 | + | then throwNotActiveGoalError() | |
292 | + | else if (isNotTrackWeekDay) | |
293 | + | then throwNotTrackWeekDayError() | |
294 | + | else if (isGoalRecordAlreadyAdded) | |
295 | + | then throwGoalRecordAlreadyAddedError() | |
296 | + | else { | |
297 | + | let recordStatus = getRecuetimeRecordStatus(recordDateTimestamp, veryProductive, productive, neutral, distracting, veryDistracting) | |
298 | + | let attempsCount = getIntegerValue(this, attempsCountKey) | |
299 | + | let failsCount = getFailsCount(recordStatus) | |
300 | + | let isFailedGoal = (failsCount > attempsCount) | |
301 | + | let categoriesEntries = [setIntegerRecord(getCategoryRecordKey(recordDateTimestamp, rescueTimeCategoryVeryProductive), veryProductive), setIntegerRecord(getCategoryRecordKey(recordDateTimestamp, rescueTimeCategoryProductive), productive), setIntegerRecord(getCategoryRecordKey(recordDateTimestamp, rescueTimeCategoryNeutral), neutral), setIntegerRecord(getCategoryRecordKey(recordDateTimestamp, rescueTimeCategoryDistracting), distracting), setIntegerRecord(getCategoryRecordKey(recordDateTimestamp, rescueTimeCategoryVeryDistracting), veryDistracting)] | |
302 | + | if (isFailedGoal) | |
303 | + | then { | |
304 | + | let adminAccountAddress = addressFromPublicKey(adminAccountPublicKey) | |
305 | + | ScriptResult(WriteSet([setStringRecord(goalStatusKey, goalStatusFail), setIntegerRecord(failsCountKey, failsCount), setStringRecord(recordStatusKey, recordStatus), categoriesEntries[0], categoriesEntries[1], categoriesEntries[2], categoriesEntries[3], categoriesEntries[4]]), TransferSet([ScriptTransfer(adminAccountAddress, bet, fromBase58String(betAssetId))])) | |
306 | + | } | |
307 | + | else if (if (isEndDate) | |
308 | + | then !(isFailedGoal) | |
309 | + | else false) | |
310 | + | then { | |
311 | + | let userAccountAddress = addressFromPublicKey(userAccountPublicKey) | |
312 | + | ScriptResult(WriteSet([setStringRecord(goalStatusKey, goalStatusSuccess), setIntegerRecord(failsCountKey, failsCount), setStringRecord(recordStatusKey, recordStatus), categoriesEntries[0], categoriesEntries[1], categoriesEntries[2], categoriesEntries[3], categoriesEntries[4]]), TransferSet([ScriptTransfer(userAccountAddress, bet, fromBase58String(betAssetId))])) | |
313 | + | } | |
314 | + | else WriteSet([setIntegerRecord(failsCountKey, failsCount), setStringRecord(recordStatusKey, recordStatus), categoriesEntries[0], categoriesEntries[1], categoriesEntries[2], categoriesEntries[3], categoriesEntries[4]]) | |
315 | + | } | |
316 | + | } | |
317 | + | ||
318 | + |
github/deemru/w8io/026f985 22.24 ms ◑