tx · FTM676SsWURMh2DGwLBgsGcUQZ9iReZdyqhHzSh5hYtR

3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx:  -0.01100000 Waves

2023.08.29 12:14 [2731794] smart account 3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx > SELF 0.00000000 Waves

{ "type": 13, "id": "FTM676SsWURMh2DGwLBgsGcUQZ9iReZdyqhHzSh5hYtR", "fee": 1100000, "feeAssetId": null, "timestamp": 1693300546463, "version": 2, "chainId": 84, "sender": "3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx", "senderPublicKey": "UGqkWsCpv7xRVXkQRXyLd6pWPDtYGXmPip7FxSd1pAu", "proofs": [ "W5xugA943qLnBWAnqek1F1fCr4da3xeEG13WWZRNGvoNthD7F1TLUJs4xSGjra3Zyzqn9Bj4aRdq16yGbvF327z" ], "script": "base64:BgIZCAISBgoEAQEBARIAEgASBAoCCAESAwoBATQAD0RFRkFVTFRMT0NBVElPTgIPQWZyaWNhX0ZfQWZyaWNhARRrZXlTdGFrZWREdWNrQnlPd25lcgEJb3duZXJBZGRyCQCsAgICEnN0YWtlZER1Y2tCeU93bmVyXwUJb3duZXJBZGRyAQ9rZXlEdWNrTG9jYXRpb24BC2R1Y2tBc3NldElkCQCsAgICDWR1Y2tMb2NhdGlvbl8FC2R1Y2tBc3NldElkAA1sYXN0VG91cklkS2V5Ag4lc19fbGFzdFRvdXJJZAEVa2V5VG91clN0YXRpY0RhdGFCeUlkAQN0SWQJAKwCAgIWJXMlZF9fdG91clN0YXRpY0RhdGFfXwkApAMBBQN0SWQBFmtleVRvdXJEeW5hbWljRGF0YUJ5SWQBA3RJZAkArAICAhclcyVkX190b3VyRHluYW1pY0RhdGFfXwkApAMBBQN0SWQBF2tleUFsbFJlZ2lzdHJhbnRzQnlUb3VyAQN0SWQJAKwCAgIWJXMlZF9fYWxsUmVnaXN0cmFudHNfXwkApAMBBQN0SWQACWlkeFN0YXRpYwAAAAppZHhEeW5hbWlj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a2V5VG91ckR5bmFtaWNEYXRhQnlJZAEFBmxhc3RJZAUSdXBkYXRlZER5bmFtaWNEYXRhBQNuaWwAAAFpARBmaW5pc2hUb3VybmFtZW50AQN0SWQEBmNhbGxlcgkApQgBCAUBaQZjYWxsZXIDCQEBIQEJAQ9jb250YWluc0VsZW1lbnQCBQphZG1pbnNMaXN0BQZjYWxsZXIJAAIBAhFQZXJtaXNzaW9uIGRlbmllZAQFdERhdGEJAQtnZXRUb3VyRGF0YQIFBHRoaXMFA3RJZAQHZHluYW1pYwkAkQMCBQV0RGF0YQUKaWR4RHluYW1pYwQGc3RhdHVzCQCRAwIFB2R5bmFtaWMFDnREeW5hbWljU3RhdHVzAwkAAAIFBnN0YXR1cwIIQVJDSElWRUQJAAIBCQCsAgIJAKwCAgILVG91cm5hbWVudCAJAKQDAQUDdElkAhQgaXMgYWxyZWFkeSBBUkNISVZFRAQSdXBkYXRlZER5bmFtaWNEYXRhCQELZHluYW1pY0RhdGEFAghBUkNISVZFRAkAkQMCBQdkeW5hbWljBQ90RHluYW1pY1dpbkR1Y2sJAQ1wYXJzZUludFZhbHVlAQkAkQMCBQdkeW5hbWljBRF0RHluYW1pY1dpblJlc3VsdAkBDXBhcnNlSW50VmFsdWUBCQCRAwIFB2R5bmFtaWMFFXREeW5hbWljVG90YWxSZWdDb3VudAkBDXBhcnNlSW50VmFsdWUBCQCRAwIFB2R5bmFtaWMFFXREeW5hbWljVG90YWxBdHRlbXB0cwkAlAoCCQDMCAIJAQtTdHJpbmdFbnRyeQIJARZrZXlUb3VyRHluYW1pY0RhdGFCeUlkAQUDdElkBRJ1cGRhdGVkRHluYW1pY0RhdGEFA25pbAAAAMX+AcQ=", "height": 2731794, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BTSgSJHAQ8HUMCNWHxd7XmWrSkvDCVfY46pyiYeuK1ju Next: A5CSo1mLr5WauaKk3Zqexpcnc11dpjzFhsAYFJHbjqQd Diff:
OldNewDifferences
3232
3333
3434 let tStaticRegisterCost = 2
35+
36+let tStaticAttemptCost = 3
3537
3638 let tStaticStart = 5
3739
265267 else {
266268 let attemptsIteratorKey = keyLastAttemptByTourAndDuck(lastId, duckAssetId)
267269 let lastAttempt = getInteger(attemptsIteratorKey)
268- let $t059656598 = if (!(isDefined(lastAttempt)))
270+ let $t059656597 = if (!(isDefined(lastAttempt)))
269271 then $Tuple2(0, 0)
270272 else if ((size(i.payments) != 1))
271273 then throw("exactly 1 payment must be attached")
276278 if ((pmtAssetId != wlgAssetId))
277279 then throw("WLGOLD payments only!")
278280 else {
279- let attCost = parseIntValue(static[tStaticRegisterCost])
281+ let attCost = parseIntValue(static[tStaticAttemptCost])
280282 if ((wlgAmt != attCost))
281283 then throw((("Need payment of " + fixedPoint(attCost, 8)) + " WLGOLD"))
282284 else $Tuple2((value(lastAttempt) + 1), 1)
283285 }
284286 }
285- let payedAttempts = $t059656598._1
286- let increment = $t059656598._2
287+ let payedAttempts = $t059656597._1
288+ let increment = $t059656597._2
287289 let updatedDynamicData = dynamicData("INPROGRESS", dynamic[tDynamicWinDuck], parseIntValue(dynamic[tDynamicWinResult]), parseIntValue(dynamic[tDynamicTotalRegCount]), (parseIntValue(dynamic[tDynamicTotalAttempts]) + increment))
288290 let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
289291 let bestResultKey = keyBestResultByTourAndDuck(lastId, duckAssetId)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let DEFAULTLOCATION = "Africa_F_Africa"
55
66 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
77
88
99 func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId)
1010
1111
1212 let lastTourIdKey = "%s__lastTourId"
1313
1414 func keyTourStaticDataById (tId) = ("%s%d__tourStaticData__" + toString(tId))
1515
1616
1717 func keyTourDynamicDataById (tId) = ("%s%d__tourDynamicData__" + toString(tId))
1818
1919
2020 func keyAllRegistrantsByTour (tId) = ("%s%d__allRegistrants__" + toString(tId))
2121
2222
2323 let idxStatic = 0
2424
2525 let idxDynamic = 1
2626
2727 func getTourData (tourContract,tId) = {
2828 let static = split(valueOrErrorMessage(getString(tourContract, keyTourStaticDataById(tId)), (("Error reading tournament " + toString(tId)) + " data")), "__")
2929 let dynamic = split(valueOrErrorMessage(getString(tourContract, keyTourDynamicDataById(tId)), (("Error reading tournament " + toString(tId)) + " data")), "__")
3030 [static, dynamic]
3131 }
3232
3333
3434 let tStaticRegisterCost = 2
35+
36+let tStaticAttemptCost = 3
3537
3638 let tStaticStart = 5
3739
3840 let tStaticEnd = 6
3941
4042 let tDynamicStatus = 1
4143
4244 let tDynamicWinDuck = 2
4345
4446 let tDynamicWinResult = 3
4547
4648 let tDynamicTotalRegCount = 4
4749
4850 let tDynamicTotalAttempts = 5
4951
5052 let locIdxContinent = 0
5153
5254 let locIdxType = 1
5355
5456 let locIdxId = 2
5557
5658 func keyLastRegisteredTourByDuck (duckAssetId) = ("%s%s__lastRegisteredTourByDuck__" + duckAssetId)
5759
5860
5961 func keyIsRegisteredByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__isRegisteredByTourAndDuck", toString(tId), duckAssetId], "__")
6062
6163
6264 func keyLastAttemptByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__lastAttemptByTourAndDuck", toString(tId), duckAssetId], "__")
6365
6466
6567 func keyBestResultByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__bestResultByTourAndDuck", toString(tId), duckAssetId], "__")
6668
6769
6870 let chain = take(drop(this.bytes, 1), 1)
6971
7072 let defaultRestAddressStr = match chain {
7173 case _ =>
7274 if ((base58'2W' == $match0))
7375 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
7476 else if ((base58'2T' == $match0))
7577 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
7678 else throw("Unknown chain")
7779 }
7880
7981 let SEP = "__"
8082
8183 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
8284
8385
8486 let IdxCfgStakingDapp = 1
8587
8688 let IdxCfgWlgDapp = 4
8789
8890 func keyRestCfg () = "%s__restConfig"
8991
9092
9193 func keyRestAddress () = "%s__restAddr"
9294
9395
9496 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
9597
9698
9799 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
98100
99101
100102 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
101103
102104 let restCfg = readRestCfgOrFail(restContract)
103105
104106 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
105107
106108 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
107109
108110 let wlgAssetIdKey = "wlg_assetId"
109111
110112 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "Not initialized yet")
111113
112114 func asString (v) = match v {
113115 case s: String =>
114116 s
115117 case _ =>
116118 throw("fail to cast into String")
117119 }
118120
119121
120122 func asInt (v) = match v {
121123 case n: Int =>
122124 n
123125 case _ =>
124126 throw("fail to cast into Int")
125127 }
126128
127129
128130 func fixedPoint (val,decimals) = {
129131 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
130132 let lowPart = toString((val % tenPow))
131133 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
132134 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
133135 }
134136
135137
136138 let MAXTOURNAMENTLENGTH = 432000000
137139
138140 let HOUR = 3600000
139141
140142 let adminsList = [toString(this), match chain {
141143 case _ =>
142144 if ((base58'2W' == $match0))
143145 then "3PEe2RELUHCFCBsmSCNcBJ8N3URLVQende7"
144146 else if ((base58'2T' == $match0))
145147 then "3MtBgJTaLxPB3C7UJD1UE8qjkHthfKvFQYY"
146148 else throw("Unknown chain")
147149 }]
148150
149151 func staticData (txId,registerCost,attemptCost,creationTime,startTime,endTime) = makeString(["%s%d%d%d%d%d", txId, toString(registerCost), toString(attemptCost), toString(creationTime), toString(startTime), toString(endTime)], SEP)
150152
151153
152154 func dynamicData (status,winDuck,winResult,totalRegs,totalAttempts) = makeString(["%s%s%d%d%d", status, winDuck, toString(winResult), toString(totalRegs), toString(totalAttempts)], SEP)
153155
154156
155157 func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil))
156158
157159
158160 func duckByCaller (caller) = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(caller))), "You don't have a duck staked")
159161
160162
161163 @Callable(i)
162164 func createTournament (startTime,endTime,registerCost,attemptCost) = {
163165 let caller = toString(i.caller)
164166 if (!(containsElement(adminsList, caller)))
165167 then throw("Permission denied")
166168 else {
167169 let lastId = getInteger(lastTourIdKey)
168170 let tId = if (isDefined(lastId))
169171 then {
170172 let lastTourId = value(lastId)
171173 let dynamic = valueOrErrorMessage(getString(keyTourDynamicDataById(lastTourId)), (("Error reading tournament " + toString(lastTourId)) + " data"))
172174 let status = split(dynamic, SEP)[tDynamicStatus]
173175 if ((status != "ARCHIVED"))
174176 then throw(("Current tournement is not completed, status=" + status))
175177 else (lastTourId + 1)
176178 }
177179 else 1
178180 let now = lastBlock.timestamp
179181 if ((now > startTime))
180182 then throw(((("startTime=" + toString(startTime)) + " < creationTime=") + toString(now)))
181183 else if ((startTime > endTime))
182184 then throw(((("endTime=" + toString(endTime)) + " < startTime=") + toString(startTime)))
183185 else if (((endTime - startTime) > MAXTOURNAMENTLENGTH))
184186 then throw(((("Tournament period exceeds max: " + toString((endTime - startTime))) + " > ") + toString(MAXTOURNAMENTLENGTH)))
185187 else if (if ((0 >= registerCost))
186188 then true
187189 else (0 >= attemptCost))
188190 then throw(((("Cost should be positive, but passed " + toString(registerCost)) + " and ") + toString(attemptCost)))
189191 else $Tuple2([IntegerEntry(lastTourIdKey, tId), StringEntry(keyTourStaticDataById(tId), staticData(toBase58String(i.transactionId), registerCost, attemptCost, now, startTime, endTime)), StringEntry(keyTourDynamicDataById(tId), dynamicData("CREATED", " ", 0, 0, 0))], tId)
190192 }
191193 }
192194
193195
194196
195197 @Callable(i)
196198 func register () = {
197199 let prologResult = prolog()
198200 if ((size(i.payments) != 1))
199201 then throw("exactly 1 payment must be attached")
200202 else {
201203 let pmt = i.payments[0]
202204 let wlgAmt = pmt.amount
203205 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WLGOLD payments only!")
204206 if ((pmtAssetId != wlgAssetId))
205207 then throw("WLGOLD payments only!")
206208 else {
207209 let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments")
208210 let now = lastBlock.timestamp
209211 let tData = getTourData(this, lastId)
210212 let static = tData[idxStatic]
211213 let dynamic = tData[idxDynamic]
212214 let status = dynamic[tDynamicStatus]
213215 if (!(if (if (if ((status == "CREATED"))
214216 then (now > parseIntValue(static[tStaticStart]))
215217 else false)
216218 then ((parseIntValue(static[tStaticEnd]) - HOUR) > now)
217219 else false)
218220 then true
219221 else if ((status == "INPROGRESS"))
220222 then ((parseIntValue(static[tStaticEnd]) - HOUR) > now)
221223 else false))
222224 then throw("Cannot register now")
223225 else {
224226 let regCost = parseIntValue(static[tStaticRegisterCost])
225227 if ((wlgAmt != regCost))
226228 then throw((("Need payment of " + fixedPoint(regCost, 8)) + " WLGOLD"))
227229 else {
228230 let duckAssetId = duckByCaller(i.originCaller)
229231 let oldRegistrants = valueOrElse(getString(keyAllRegistrantsByTour(lastId)), "")
230232 let regList = if ((oldRegistrants == ""))
231233 then nil
232234 else split_51C(oldRegistrants, "_")
233235 if (if (valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(lastId, duckAssetId)), false))
234236 then true
235237 else containsElement(regList, duckAssetId))
236238 then throw(((("Your duck " + duckAssetId) + " is already registered at tournament ") + toString(lastId)))
237239 else {
238240 let updatedDynamicData = dynamicData("INPROGRESS", dynamic[tDynamicWinDuck], parseIntValue(dynamic[tDynamicWinResult]), (parseIntValue(dynamic[tDynamicTotalRegCount]) + 1), parseIntValue(dynamic[tDynamicTotalAttempts]))
239241 $Tuple2([IntegerEntry(keyLastRegisteredTourByDuck(duckAssetId), lastId), BooleanEntry(keyIsRegisteredByTourAndDuck(lastId, duckAssetId), true), StringEntry(keyAllRegistrantsByTour(lastId), makeString_11C((regList :+ duckAssetId), "_")), StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)], prologResult)
240242 }
241243 }
242244 }
243245 }
244246 }
245247 }
246248
247249
248250
249251 @Callable(i)
250252 func newAttempt () = {
251253 let prologResult = prolog()
252254 let duckAssetId = duckByCaller(i.originCaller)
253255 let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments")
254256 let now = lastBlock.timestamp
255257 let tData = getTourData(this, lastId)
256258 let static = tData[idxStatic]
257259 let dynamic = tData[idxDynamic]
258260 let status = dynamic[tDynamicStatus]
259261 if (!(if ((status == "INPROGRESS"))
260262 then ((parseIntValue(static[tStaticEnd]) - HOUR) > now)
261263 else false))
262264 then throw("Attempt is not possible")
263265 else if (!(valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(lastId, duckAssetId)), false)))
264266 then throw(((("Your duck " + duckAssetId) + " is not registered at tournament ") + toString(lastId)))
265267 else {
266268 let attemptsIteratorKey = keyLastAttemptByTourAndDuck(lastId, duckAssetId)
267269 let lastAttempt = getInteger(attemptsIteratorKey)
268- let $t059656598 = if (!(isDefined(lastAttempt)))
270+ let $t059656597 = if (!(isDefined(lastAttempt)))
269271 then $Tuple2(0, 0)
270272 else if ((size(i.payments) != 1))
271273 then throw("exactly 1 payment must be attached")
272274 else {
273275 let pmt = i.payments[0]
274276 let wlgAmt = pmt.amount
275277 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WLGOLD payments only!")
276278 if ((pmtAssetId != wlgAssetId))
277279 then throw("WLGOLD payments only!")
278280 else {
279- let attCost = parseIntValue(static[tStaticRegisterCost])
281+ let attCost = parseIntValue(static[tStaticAttemptCost])
280282 if ((wlgAmt != attCost))
281283 then throw((("Need payment of " + fixedPoint(attCost, 8)) + " WLGOLD"))
282284 else $Tuple2((value(lastAttempt) + 1), 1)
283285 }
284286 }
285- let payedAttempts = $t059656598._1
286- let increment = $t059656598._2
287+ let payedAttempts = $t059656597._1
288+ let increment = $t059656597._2
287289 let updatedDynamicData = dynamicData("INPROGRESS", dynamic[tDynamicWinDuck], parseIntValue(dynamic[tDynamicWinResult]), parseIntValue(dynamic[tDynamicTotalRegCount]), (parseIntValue(dynamic[tDynamicTotalAttempts]) + increment))
288290 let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
289291 let bestResultKey = keyBestResultByTourAndDuck(lastId, duckAssetId)
290292 let best = if (if ((curLocation[locIdxType] == "T"))
291293 then (parseIntValue(curLocation[locIdxContinent]) == lastId)
292294 else false)
293295 then {
294296 let bestResult = valueOrElse(getInteger(bestResultKey), 0)
295297 let curResult = parseIntValue(curLocation[locIdxId])
296298 max([bestResult, curResult])
297299 }
298300 else 0
299301 let tourLoc = asString(invoke(stakingContract, "initDuckTourAttempt", [duckAssetId], nil))
300302 $Tuple2([IntegerEntry(bestResultKey, best), IntegerEntry(attemptsIteratorKey, payedAttempts), StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)], [prologResult, payedAttempts, tourLoc])
301303 }
302304 }
303305
304306
305307
306308 @Callable(i)
307309 func updateDynamicData (duckAssetId,newBest) = if ((i.caller != stakingContract))
308310 then throw("Access denied")
309311 else {
310312 let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments")
311313 let tData = getTourData(this, lastId)
312314 let static = tData[idxStatic]
313315 let dynamic = tData[idxDynamic]
314316 if (if (if ((parseIntValue(dynamic[tDynamicWinResult]) >= newBest))
315317 then true
316318 else (dynamic[tDynamicStatus] != "INPROGRESS"))
317319 then true
318320 else (lastBlock.timestamp > parseIntValue(static[tStaticEnd])))
319321 then $Tuple2(nil, 0)
320322 else {
321323 let updatedDynamicData = dynamicData("INPROGRESS", duckAssetId, newBest, parseIntValue(dynamic[tDynamicTotalRegCount]), parseIntValue(dynamic[tDynamicTotalAttempts]))
322324 $Tuple2([StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)], 0)
323325 }
324326 }
325327
326328
327329
328330 @Callable(i)
329331 func finishTournament (tId) = {
330332 let caller = toString(i.caller)
331333 if (!(containsElement(adminsList, caller)))
332334 then throw("Permission denied")
333335 else {
334336 let tData = getTourData(this, tId)
335337 let dynamic = tData[idxDynamic]
336338 let status = dynamic[tDynamicStatus]
337339 if ((status == "ARCHIVED"))
338340 then throw((("Tournament " + toString(tId)) + " is already ARCHIVED"))
339341 else {
340342 let updatedDynamicData = dynamicData("ARCHIVED", dynamic[tDynamicWinDuck], parseIntValue(dynamic[tDynamicWinResult]), parseIntValue(dynamic[tDynamicTotalRegCount]), parseIntValue(dynamic[tDynamicTotalAttempts]))
341343 $Tuple2([StringEntry(keyTourDynamicDataById(tId), updatedDynamicData)], 0)
342344 }
343345 }
344346 }
345347
346348

github/deemru/w8io/169f3d6 
57.47 ms