tx · 5tgHADQFwNKVytBwv65AQZfx5EJWBB3Zt45jqUvNAXkf

3MuoM7pcWxWuwtDk6ouDYpTgKWjyyt4ytGo:  -0.01000000 Waves

2020.05.09 20:13 [990919] smart account 3MuoM7pcWxWuwtDk6ouDYpTgKWjyyt4ytGo > SELF 0.00000000 Waves

{ "type": 13, "id": "5tgHADQFwNKVytBwv65AQZfx5EJWBB3Zt45jqUvNAXkf", "fee": 1000000, "feeAssetId": null, "timestamp": 1589044446800, "version": 1, "sender": "3MuoM7pcWxWuwtDk6ouDYpTgKWjyyt4ytGo", "senderPublicKey": "BcUJRQgSmqgm1rNM6npyLuyqKEUNx6PKtdexG8ZzEoSa", "proofs": [ "3fRx4WsBLAmUU6oShaBMGUPHe4EegzWFQFnMFmWiNqcwxPHfWgfqi8SV2Qvy9KTWs9hQi1fzKnAeqxkzkY4LMtDm" ], "script": "base64:AAIDAAAAAAAAABwIARINCgsICAEBAQgICAEBCBIJCgcBCAEBAQEBAAAARwAAAAAXcmVzY3VlVGltZUNvbmRpdGlvbkxlc3MCAAAABGxlc3MAAAAAF3Jlc2N1ZVRpbWVDb25kaXRpb25Nb3JlAgAAAARtb3JlAAAAACByZXNjdWVUaW1lQ2F0ZWdvcnlWZXJ5UHJvZHVjdGl2ZQIAAAAOdmVyeVByb2R1Y3RpdmUAAAAAHHJlc2N1ZVRpbWVDYXRlZ29yeVByb2R1Y3RpdmUCAAAACnByb2R1Y3RpdmUAAAAAGXJlc2N1ZVRpbWVDYXRlZ29yeU5ldXRyYWwCAAAAB25ldXRyYWwAAAAAHXJlc2N1ZVRpbWVDYXRlZ29yeURpc3RyYWN0aW5nAgAAAAtkaXN0cmFjdGluZwAAAAAhcmVzY3VlVGltZUNhdGVnb3J5VmVyeURpc3RyYWN0aW5nAgAAAA92ZXJ5RGlzdHJhY3RpbmcAAAAAEWdvYWxTdGF0dXNQZW5kaW5nAgAAAAdwZW5kaW5nAAAAABBnb2FsU3RhdHVzQWN0aXZlAgAAAAZhY3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EwAAAACCQABkQAAAAIFAAAAEWNhdGVnb3JpZXNFbnRyaWVzAAAAAAAAAAACCQAETAAAAAIJAAGRAAAAAgUAAAARY2F0ZWdvcmllc0VudHJpZXMAAAAAAAAAAAMJAARMAAAAAgkAAZEAAAACBQAAABFjYXRlZ29yaWVzRW50cmllcwAAAAAAAAAABAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEnVzZXJBY2NvdW50QWRkcmVzcwUAAAADYmV0CQACWQAAAAEFAAAACmJldEFzc2V0SWQFAAAAA25pbAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAQc2V0SW50ZWdlclJlY29yZAAAAAIFAAAADWZhaWxzQ291bnRLZXkFAAAACmZhaWxzQ291bnQJAARMAAAAAgkBAAAAD3NldFN0cmluZ1JlY29yZAAAAAIFAAAAD3JlY29yZFN0YXR1c0tleQUAAAAMcmVjb3JkU3RhdHVzCQAETAAAAAIJAAGRAAAAAgUAAAARY2F0ZWdvcmllc0VudHJpZXMAAAAAAAAAAAAJAARMAAAAAgkAAZEAAAACBQAAABFjYXRlZ29yaWVzRW50cmllcwAAAAAAAAAAAQkABEwAAAACCQABkQAAAAIFAAAAEWNhdGVnb3JpZXNFbnRyaWVzAAAAAAAAAAACCQAETAAAAAIJAAGRAAAAAgUAAAARY2F0ZWdvcmllc0VudHJpZXMAAAAAAAAAAAMJAARMAAAAAgkAAZEAAAACBQAAABFjYXRlZ29yaWVzRW50cmllcwAAAAAAAAAABAUAAAADbmlsAAAAAJdCGDw=", "chainId": 84, "height": 990919, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
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'kooPNxZfjTcGHHiHCje9ESYtbbb3z8kPYCduUAk77Kb'
79+
80+let goalAccountPublicKey = base58'BcUJRQgSmqgm1rNM6npyLuyqKEUNx6PKtdexG8ZzEoSa'
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(getInteger(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 = getStringRecord(this, rescueTimeConditionKey)
217+ let rescueTimeCategory = getStringRecord(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, "startDate", 0)
277+ let endDateTimestamp = getIntegerRecordOr(this, "endDate", 0)
278+ let isOutdatedGoal = if ((startDateTimestamp > recordDateTimestamp))
279+ then (recordDateTimestamp > endDateTimestamp)
280+ else false
281+ let isEndDate = (recordDateTimestamp == endDateTimestamp)
282+ let isNotActiveStatus = (getStringRecord(this, "status") != 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 
38.61 ms