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