tx · 4JnworN4PmXuiwCviRg9hdgBSX6uJS82yw2c8cYVhpKv

3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm:  -0.01100000 Waves

2022.12.06 15:14 [2348474] smart account 3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm > SELF 0.00000000 Waves

{ "type": 13, "id": "4JnworN4PmXuiwCviRg9hdgBSX6uJS82yw2c8cYVhpKv", "fee": 1100000, "feeAssetId": null, "timestamp": 1670328819848, "version": 2, "chainId": 84, "sender": "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm", "senderPublicKey": "EVooykMNV691Venwp1dHUTBd7KWequzUcda57Wd3LQEX", "proofs": [ "3axH2T5u4buN9NZrQb1SKtJDaN5WWcxnnKeUGjJehAt7GteesKh35uqBhHYH6dsS6uySKHL1c9NVQHARqUWny1tC" ], "script": "base64:BgIoCAISABIDCgEIEgASAwoBCBIECgIBCBIECgICAhIECgIBCBIECgIICCkAC3VzZG5Bc3NldElkASD3dur394PKZdtuE+4CO89YKZWpwdGN8kvabNgdYoDI3gANaW5jdWJhdG9yQWRkcgUEdGhpcwALYnJlZWRlckFkZHIFBHRoaXMAC2JhY2tFbmRBZGRyCQERQGV4dHJOYXRpdmUoMTA2MikBAiMzTjVTcFgyMVIzUjc1UW80ZWIzTXdGRnZXN1RVenlodmF2dgALZWNvbm9teUFkZHIJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOOHk0d3hYM0pDNFRkckNKQlhYMTZTaldmNlgyNTZocmVwAANwdWIBIE9T4ho/VKjWnVJOEx1GJ1W9s1PzLHvJVFSw/0PBtBQoAApMQU5EUFJFRklYAgRMQU5EAApEVUNLUFJFRklYAgREVUNLAA9ERUZBVUxUTE9DQVRJT04CD0FmcmljYV9GX0FmcmljYQAPREFJTFlSRVNCWVBJRUNFAID40gEACURBWU1JTExJUwCAuJkpABFGSVZFTUlOVVRFU01JTExJUwDgpxIBEWtleUFzc2V0SWRUb093bmVyAQdhc3NldElkCQCsAgICCW5md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CAEIBQFpBmNhbGxlcgIcWW91IGRvbid0IGhhdmUgYSBkdWNrIHN0YWtlZAMDCQBmAgAABQZoZWFsdGgGCQBmAgUGaGVhbHRoAGQJAAIBAhpIUCBzaG91bGQgYmUgd2l0aGluIDAuLjEwMAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBDWtleUR1Y2tIZWFsdGgBBQtkdWNrQXNzZXRJZAUGaGVhbHRoBQNuaWwBaQEOdXBkYXRlQmFja3BhY2sCC2R1Y2tBc3NldElkB25ld1BhY2sDCQECIT0CCAUBaQZjYWxsZXIFC2Vjb25vbXlBZGRyCQACAQIRcGVybWlzc2lvbiBkZW5pZWQJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQERa2V5QmFja3BhY2tCeUR1Y2sBBQtkdWNrQXNzZXRJZAUHbmV3UGFjawUDbmlsBQduZXdQYWNrALPSIhU=", "height": 2348474, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7stjs2tXEBWacjt8eKA3xfWxDAJqdPspwn9xbDNw6RsS Next: 6U3sR1H1EKBorGnsBCEp9vLN4zEWnV7rU7RTXDDon5hs Diff:
OldNewDifferences
2626 let FIVEMINUTESMILLIS = 300000
2727
2828 func keyAssetIdToOwner (assetId) = ("nftOwner_" + assetId)
29+
30+
31+func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId)
2932
3033
3134 func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId)
215218 let health = getInteger(keyHealth)
216219 let bpKey = keyBackpackByDuck(assetIdStr)
217220 let backpack = getString(bpKey)
218- ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyAssetIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location))
221+ ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyDuckIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location))
219222 then nil
220223 else ([StringEntry(locKey, DEFAULTLOCATION)] ++ (if (isDefined(health))
221224 then nil
249252 else if (!(isDefined(keyStakedDuckByOwner(address))))
250253 then throw((("The duck " + asset.name) + " is not staked"))
251254 else {
252- let owner = valueOrErrorMessage(getString(keyAssetIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned"))
255+ let owner = valueOrErrorMessage(getString(keyDuckIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned"))
253256 if ((owner != address))
254257 then throw("Staked NFT is not yours")
255258 else [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyDuckLocation(assetIdStr)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, assetIdStr, address)), DeleteEntry(keyStakedDuckByOwner(address))]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let usdnAssetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
55
66 let incubatorAddr = this
77
88 let breederAddr = this
99
1010 let backEndAddr = addressFromStringValue("3N5SpX21R3R75Qo4eb3MwFFvW7TUzyhvavv")
1111
1212 let economyAddr = addressFromStringValue("3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep")
1313
1414 let pub = base58'6LfPuKJjLgekmncBhMg2LZyMTNVzZBccXR28ySXm9uXD'
1515
1616 let LANDPREFIX = "LAND"
1717
1818 let DUCKPREFIX = "DUCK"
1919
2020 let DEFAULTLOCATION = "Africa_F_Africa"
2121
2222 let DAILYRESBYPIECE = 3456000
2323
2424 let DAYMILLIS = 86400000
2525
2626 let FIVEMINUTESMILLIS = 300000
2727
2828 func keyAssetIdToOwner (assetId) = ("nftOwner_" + assetId)
29+
30+
31+func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId)
2932
3033
3134 func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId)
3235
3336
3437 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
3538
3639
3740 func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr)
3841
3942
4043 func keyLandToOwner (landNum) = ("landOwner_" + landNum)
4144
4245
4346 func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId)
4447
4548
4649 func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId)
4750
4851
4952 func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId)
5053
5154
5255 let recLandNum = 0
5356
5457 let recLandSize = 1
5558
5659 let recTerrains = 2
5760
5861 let recContinent = 3
5962
6063 let locIdxContinent = 0
6164
6265 let locIdxType = 1
6366
6467 let locIdxId = 2
6568
6669 let bpIdxLevel = 0
6770
6871 let bpIdxRes = 1
6972
7073 let bpIdxMat = 2
7174
7275 let bpIdxProd = 3
7376
7477 let idxA = 0
7578
7679 let idxB = 1
7780
7881 let idxC = 2
7982
8083 let idxD = 3
8184
8285 let idxE = 4
8386
8487 let idxF = 5
8588
8689 func countTerrains (terrains) = [(size(split(terrains, "A")) - 1), (size(split(terrains, "B")) - 1), (size(split(terrains, "C")) - 1), (size(split(terrains, "D")) - 1), (size(split(terrains, "E")) - 1), (size(split(terrains, "F")) - 1)]
8790
8891
8992 func numPiecesBySize (landSize) = match landSize {
9093 case _ =>
9194 if (("S" == $match0))
9295 then 25
9396 else if (("M" == $match0))
9497 then 100
9598 else if (("L" == $match0))
9699 then 225
97100 else if (("XL" == $match0))
98101 then 400
99102 else if (("XXL" == $match0))
100103 then 625
101104 else throw("Unknown land size")
102105 }
103106
104107
105108 func addRes (currentRes,terrainCounts,deltaTime) = {
106109 func adder (acc,i) = {
107110 let resOfType = (fraction(deltaTime, DAILYRESBYPIECE, DAYMILLIS) * terrainCounts[i])
108111 (acc :+ toString((parseIntValue(currentRes[i]) + resOfType)))
109112 }
110113
111114 let r = {
112115 let $l = [0, 1, 2, 3, 4, 5]
113116 let $s = size($l)
114117 let $acc0 = nil
115118 func $f0_1 ($a,$i) = if (($i >= $s))
116119 then $a
117120 else adder($a, $l[$i])
118121
119122 func $f0_2 ($a,$i) = if (($i >= $s))
120123 then $a
121124 else throw("List size exceeds 6")
122125
123126 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
124127 }
125128 makeString(r, "_")
126129 }
127130
128131
129132 @Callable(i)
130133 func stakeLand () = {
131134 let pmt = value(i.payments[0])
132135 let assetId = value(pmt.assetId)
133136 let address = toString(i.caller)
134137 if ((pmt.amount != 1))
135138 then throw((("NFT " + LANDPREFIX) + " token should be attached as payment"))
136139 else {
137140 let asset = value(assetInfo(assetId))
138141 if ((asset.issuer != this))
139142 then throw("Unknown issuer of token")
140143 else if (!(contains(asset.name, LANDPREFIX)))
141144 then throw((("Only NFT " + LANDPREFIX) + " tokens are accepted"))
142145 else {
143146 let landNumSize = drop(asset.name, 4)
144147 let landNum = if (contains(landNumSize, "XXL"))
145148 then dropRight(landNumSize, 3)
146149 else if (contains(landNumSize, "XL"))
147150 then dropRight(landNumSize, 2)
148151 else dropRight(landNumSize, 1)
149152 if (!(isDefined(parseInt(landNum))))
150153 then throw(("Cannot parse land number from " + asset.name))
151154 else {
152155 let timeKey = keyStakedTimeByAssetId(toBase58String(assetId))
153156 if (isDefined(getInteger(timeKey)))
154157 then throw((("NFT " + asset.name) + " is already staked"))
155158 else [IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyAssetIdToOwner(toBase58String(assetId)), address), StringEntry(keyLandToOwner(landNum), address)]
156159 }
157160 }
158161 }
159162 }
160163
161164
162165
163166 @Callable(i)
164167 func unstakeLand (landAssetId) = if ((size(i.payments) != 0))
165168 then throw("unstake doesn't require any payments")
166169 else {
167170 let assetId = fromBase58String(landAssetId)
168171 let address = toString(i.caller)
169172 let asset = value(assetInfo(assetId))
170173 if ((asset.issuer != this))
171174 then throw("Unknown issuer of token")
172175 else if (!(contains(asset.name, LANDPREFIX)))
173176 then throw((("Only NFT " + LANDPREFIX) + " tokens can be unstaked"))
174177 else {
175178 let timeKey = keyStakedTimeByAssetId(landAssetId)
176179 if (!(isDefined(timeKey)))
177180 then throw((("NFT " + asset.name) + " is not staked"))
178181 else {
179182 let owner = valueOrErrorMessage(getString(keyAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
180183 if ((owner != address))
181184 then throw("Staked NFT is not yours")
182185 else [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address))]
183186 }
184187 }
185188 }
186189
187190
188191
189192 @Callable(i)
190193 func stakeDuck () = {
191194 let pmt = value(i.payments[0])
192195 let assetId = value(pmt.assetId)
193196 let address = toString(i.caller)
194197 if ((pmt.amount != 1))
195198 then throw((("NFT " + DUCKPREFIX) + " token should be attached as payment"))
196199 else {
197200 let asset = value(assetInfo(assetId))
198201 if (if ((asset.issuer != incubatorAddr))
199202 then (asset.issuer != breederAddr)
200203 else false)
201204 then throw((("Unknown issuer of " + DUCKPREFIX) + " token"))
202205 else if (!(contains(asset.name, DUCKPREFIX)))
203206 then throw((("Only NFT " + DUCKPREFIX) + " tokens are accepted"))
204207 else {
205208 let assetIdStr = toBase58String(assetId)
206209 let timeKey = keyStakedTimeByAssetId(assetIdStr)
207210 if (isDefined(getInteger(timeKey)))
208211 then throw((("NFT " + asset.name) + " is already staked"))
209212 else if (isDefined(getString(keyStakedDuckByOwner(address))))
210213 then throw(("You already staked one duck: " + asset.name))
211214 else {
212215 let locKey = keyDuckLocation(assetIdStr)
213216 let location = getString(locKey)
214217 let keyHealth = keyDuckHealth(assetIdStr)
215218 let health = getInteger(keyHealth)
216219 let bpKey = keyBackpackByDuck(assetIdStr)
217220 let backpack = getString(bpKey)
218- ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyAssetIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location))
221+ ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyDuckIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location))
219222 then nil
220223 else ([StringEntry(locKey, DEFAULTLOCATION)] ++ (if (isDefined(health))
221224 then nil
222225 else ([IntegerEntry(keyHealth, 100)] ++ (if (isDefined(backpack))
223226 then nil
224227 else [StringEntry(bpKey, "0:0_0_0_0_0_0::")]))))))
225228 }
226229 }
227230 }
228231 }
229232
230233
231234
232235 @Callable(i)
233236 func unstakeDuck (assetIdStr) = if ((size(i.payments) != 0))
234237 then throw("unstake doesn't require any payments")
235238 else {
236239 let assetId = fromBase58String(assetIdStr)
237240 let address = toString(i.caller)
238241 let asset = value(assetInfo(assetId))
239242 if (if ((asset.issuer != incubatorAddr))
240243 then (asset.issuer != breederAddr)
241244 else false)
242245 then throw((("Unknown issuer of " + DUCKPREFIX) + " token"))
243246 else if (!(contains(asset.name, DUCKPREFIX)))
244247 then throw((("Only NFT " + DUCKPREFIX) + " tokens can be unstaked"))
245248 else {
246249 let timeKey = keyStakedTimeByAssetId(toBase58String(assetId))
247250 if (!(isDefined(timeKey)))
248251 then throw((("NFT " + asset.name) + " is not staked"))
249252 else if (!(isDefined(keyStakedDuckByOwner(address))))
250253 then throw((("The duck " + asset.name) + " is not staked"))
251254 else {
252- let owner = valueOrErrorMessage(getString(keyAssetIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned"))
255+ let owner = valueOrErrorMessage(getString(keyDuckIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned"))
253256 if ((owner != address))
254257 then throw("Staked NFT is not yours")
255258 else [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyDuckLocation(assetIdStr)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, assetIdStr, address)), DeleteEntry(keyStakedDuckByOwner(address))]
256259 }
257260 }
258261 }
259262
260263
261264
262265 @Callable(i)
263266 func claimRes (amount,landAssetId) = if ((size(i.payments) != 0))
264267 then throw("claimRes doesn't require any payments")
265268 else {
266269 let addr = toString(i.caller)
267270 let asset = value(assetInfo(fromBase58String(landAssetId)))
268271 if (!(contains(asset.name, LANDPREFIX)))
269272 then throw((("NFT " + LANDPREFIX) + " token should be passed as param"))
270273 else {
271274 let timeKey = keyStakedTimeByAssetId(landAssetId)
272275 let savedTime = getInteger(timeKey)
273276 if (!(isDefined(savedTime)))
274277 then throw((("NFT " + asset.name) + " is not staked"))
275278 else {
276279 let owner = getStringValue(keyAssetIdToOwner(landAssetId))
277280 if ((owner != addr))
278281 then throw((LANDPREFIX + " is not yours"))
279282 else {
280283 let d = split(asset.description, "_")
281284 let landSize = d[recLandSize]
282285 let terrainCounts = countTerrains(d[recTerrains])
283286 let duck = getString(keyStakedDuckByOwner(addr))
284287 if (!(isDefined(duck)))
285288 then throw("You don't have a duck staked")
286289 else {
287290 let duckAssetIdStr = value(duck)
288291 let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetIdStr)), DEFAULTLOCATION)
289292 let loc = split(value(curLocation), "_")
290293 if ((loc[locIdxType] != "L"))
291294 then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
292295 else if ((loc[locIdxId] != landAssetId))
293296 then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId))
294297 else {
295298 let deltaTime = (lastBlock.timestamp - value(savedTime))
296299 if ((0 > deltaTime))
297300 then throw(((("Saved timestamp is in future, saved = " + toString(value(savedTime))) + ", current = ") + toString(lastBlock.timestamp)))
298301 else {
299302 let pieces = numPiecesBySize(landSize)
300303 let availRes = (fraction(deltaTime, DAILYRESBYPIECE, DAYMILLIS) * pieces)
301304 if ((amount > availRes))
302305 then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount)))
303306 else {
304307 let newDeltaTime = fraction((availRes - amount), DAYMILLIS, (pieces * DAILYRESBYPIECE))
305308 let newTimestamp = (lastBlock.timestamp - newDeltaTime)
306309 let bpKey = keyBackpackByDuck(duckAssetIdStr)
307310 let currentPack = split(valueOrElse(getString(bpKey), "0:0_0_0_0_0_0::"), ":")
308311 let currentRes = split(currentPack[bpIdxRes], "_")
309312 let bpRes = addRes(currentRes, terrainCounts, (deltaTime - newDeltaTime))
310313 let newPack = makeString([currentPack[bpIdxLevel], bpRes, currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
311314 $Tuple2([StringEntry(bpKey, newPack), IntegerEntry(timeKey, newTimestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, owner), newTimestamp)], unit)
312315 }
313316 }
314317 }
315318 }
316319 }
317320 }
318321 }
319322 }
320323
321324
322325
323326 @Callable(i)
324327 func flight (message,sig) = if (!(sigVerify_8Kb(message, sig, pub)))
325328 then throw("signature does not match")
326329 else if ((size(i.payments) != 0))
327330 then throw("flight doesn't require any payments")
328331 else {
329332 let parts = split(toUtf8String(message), ";")
330333 let hp = split(split(parts[0], "|")[0], "_")
331334 let curHP = parseIntValue(hp[1])
332335 let newHP = parseIntValue(hp[1])
333336 let newLocAndTime = split(parts[1], ":")
334337 let newLocation = newLocAndTime[0]
335338 let time = parseIntValue(newLocAndTime[1])
336339 if (if ((time > lastBlock.timestamp))
337340 then true
338341 else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time))
339342 then throw("signature outdated")
340343 else {
341344 let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
342345 let keyHealth = keyDuckHealth(duckAssetId)
343346 let oldFromState = valueOrElse(getInteger(keyHealth), 100)
344347 if ((oldFromState != curHP))
345348 then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP)))
346349 else {
347350 let locKey = keyDuckLocation(duckAssetId)
348351 let curLocation = valueOrElse(getString(locKey), DEFAULTLOCATION)
349352 if ((newLocation == curLocation))
350353 then throw("You can't fly to the same location")
351354 else $Tuple2([StringEntry(locKey, if ((newHP > 0))
352355 then newLocation
353356 else curLocation), IntegerEntry(keyHealth, newHP)], unit)
354357 }
355358 }
356359 }
357360
358361
359362
360363 @Callable(i)
361364 func setHealth (health,duckAssetId) = {
362365 let duckAssetIdStr = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
363366 if (if ((0 > health))
364367 then true
365368 else (health > 100))
366369 then throw("HP should be within 0..100")
367370 else [IntegerEntry(keyDuckHealth(duckAssetId), health)]
368371 }
369372
370373
371374
372375 @Callable(i)
373376 func updateBackpack (duckAssetId,newPack) = if ((i.caller != economyAddr))
374377 then throw("permission denied")
375378 else $Tuple2([StringEntry(keyBackpackByDuck(duckAssetId), newPack)], newPack)
376379
377380

github/deemru/w8io/169f3d6 
66.00 ms